sum first and last number of array
Afficher commentaires plus anciens
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
Réponses (1)
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.
Catégories
En savoir plus sur Matrix Indexing dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!