just started matlab just wondering how to set up a 'for' loop

4 次查看(过去 30 天)
  6 个评论
Bethany Young
Bethany Young 2021-11-22
编辑:Bethany Young 2021-11-22
ive been asked to do the first 10 terms so ive just changed inf to 10

请先登录,再进行评论。

回答(1 个)

James Tursa
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.

类别

Help CenterFile Exchange 中查找有关 MATLAB 的更多信息

产品


版本

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by