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.
조회 수: 1 (최근 30일)
이전 댓글 표시
clc
clear
x=0;
for i=1:5
y(i)=x+i
z=sum(y(i))
end
댓글 수: 0
채택된 답변
추가 답변 (0개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!