Azzera filtri
Azzera filtri

i have a matrix like:A=[9 7 8 4 2 5 1 8 6 12]. i wanna add the first 5 elements .how can I do this?

1 visualizzazione (ultimi 30 giorni)
i have a matrix like:A=[9 7 8 4 2 5 1 8 6 12]. i wanna add the first 5 elements .how can I do this?

Risposta accettata

Image Analyst
Image Analyst il 23 Apr 2016
Try this:
sumFirst5 = sum(A(1:5));

Più risposte (0)

Categorie

Scopri di più su Migrate GUIDE Apps in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by