Filter löschen
Filter löschen

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 Ansicht (letzte 30 Tage)
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?

Akzeptierte Antwort

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

Weitere Antworten (0)

Kategorien

Mehr zu Migrate GUIDE Apps finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by