excuse could someone correct or modify this routine
Show older comments
Accepted Answer
More Answers (1)
jose guevara
on 1 Aug 2018
0 votes
4 Comments
X(1)=1;
for i=1:100
X(i+1)=sin(x(i));
end
disp(x(100))
Walter Roberson
on 1 Aug 2018
Note: the 100'th output is x(100), the way Dennis shows. But you also compute the 101'st output, which will be at x(101)
Dennis
on 1 Aug 2018
I was thinking exactly the same and even edited it. Then i realised that we display x and not X.
Walter Roberson
on 2 Aug 2018
Oh, good point. So it would be
X(1)=1;
for i=1:100
X(i+1)=sin(x(i));
end
disp(X(100))
or
disp(X(101))
Categories
Find more on Introduction to Installation and Licensing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!