If y(i) contain 5 values such as 1,2,3,4,5. Then i want to sum all the values with a single command but i can't solve this problem. Please help me out, my code is given below.
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Mehedi
am 9 Jun. 2014
Bearbeitet: the cyclist
am 9 Jun. 2014
clc
clear
x=0;
for i=1:5
y(i)=x+i
z=sum(y(i))
end
0 Kommentare
Akzeptierte Antwort
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Get Started with MATLAB 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!