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

4 views (last 30 days)
  6 Comments
Bethany Young
Bethany Young on 22 Nov 2021
Edited: Bethany Young on 22 Nov 2021
ive been asked to do the first 10 terms so ive just changed inf to 10
James Tursa
James Tursa on 22 Nov 2021
Then I think with the -1 exponent correction you are done.

Sign in to comment.

Answers (1)

James Tursa
James Tursa on 22 Nov 2021
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.

Categories

Find more on MATLAB in Help Center and File Exchange

Products


Release

R2020a

Community Treasure Hunt

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

Start Hunting!