Matlab script to add the values of elements

I need to do the following :
Given the vector x=[1 8 3 9 0 1],create a MATLAB script to add the values of the elements. Check your final result with the MATLAB ‘sum’ command. (Hint: use MATLAB ‘For’ loop).
I think it can be simple, but i don't understand the questing. Can someone help me ?
thanks

1 Kommentar

You have to calculate the total of the elements in x -- the value 1+8+3+9+0+1 . You need to use a for loop to do that.

Melden Sie sich an, um zu kommentieren.

Antworten (1)

madhan ravi
madhan ravi am 2 Sep. 2019

0 Stimmen

Google search "for loop sum MATLAB"

Kategorien

Mehr zu Programming finden Sie in Hilfe-Center und File Exchange

Gefragt:

am 2 Sep. 2019

Kommentiert:

am 2 Sep. 2019

Community Treasure Hunt

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

Start Hunting!

Translated by