just started matlab just wondering how to set up a 'for' loop
4 次查看(过去 30 天)
显示 更早的评论
6 个评论
回答(1 个)
James Tursa
2021-11-22
Here is an outline to get you started:
x = _____;
nmax = _____;
result = 0;
for n=1:nmax
result = result + _____;
end
You need to fill in the blanks. The x value and the maximum n value to use. For the blank inside the for-loop, you need to write an expression involving x and n that matches the terms in your sum formula.
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!