Info

This question is closed. Reopen it to edit or answer.

Did I set the problem correctly?

1 view (last 30 days)
Ruten9
Ruten9 on 10 Nov 2015
Closed: MATLAB Answer Bot on 20 Aug 2021
https://gyazo.com/a6c00ee08cdd03c313b4be970d361ac0
This is my code:
clear all;clc;
N=1;
SI= exp(-1.*N);
tol = 10.^(-1.*10);
y = zeros(1,0);
while 1,
SI= exp(-1.*N);
y(1,end+1) = SI + rand;
if SI<=tol
break;
end
N=N+1;
end
k=0:10:230;
y
N ;%number of iterations N that were required for convergence
%Plotting
plot(k,y)

Answers (0)

Community Treasure Hunt

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

Start Hunting!