sum first and last number of array

hi, if i had an array of 20 numbers, what code should i use to sum the first and the last, the second and the second to last, etc.
thanks in advance

Respuestas (1)

José-Luis
José-Luis el 5 de Mayo de 2014
Editada: José-Luis el 5 de Mayo de 2014
To give you a hint:
a = randi(10,10,1);
your_mat = sum([a flipud(a)],2);
Modify to fit your criteria.
Please accept an answer if it helped you.

Categorías

Preguntada:

el 5 de Mayo de 2014

Editada:

el 5 de Mayo de 2014

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by