plot y(i)
1 回表示 (過去 30 日間)
古いコメントを表示
[EDIT: 20110513 13:39 CDT - reformat - WDR]
hi,
i have this sum:
for i=2:200
y=y+i;
how i can use plot to trace y=f(i)
thanks in advance
0 件のコメント
回答 (1 件)
Walter Roberson
2011 年 5 月 13 日
y = cumsum(2:200);
plot(y)
Or, using the for loop
x = 2:200;
numx = length(x);
y = zeros(numx,1);
ty = 0;
for i = 1:numx
ty = ty + x(i);
y(i) = ty;
end
plot(y)
6 件のコメント
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!