excuse could someone correct or modify this routine

X(1)=1;
For i=1:100
Disp(x)
X(i+1)=sin(x(i))
End

1 commentaire

Quisiera que por favor alguien me ayudara la rutina da muchos valores solo quisiera saber si se puede modificar para que de solo los cien valores

Connectez-vous pour commenter.

 Réponse acceptée

Plus de réponses (1)

jose guevara
jose guevara le 1 Août 2018

0 votes

friend excuse my question is if you can modify the algorithm to prevent me from that amount of values and only the hundred that I ask could you please help me

4 commentaires

Dennis
Dennis le 1 Août 2018
Modifié(e) : Dennis le 1 Août 2018
X(1)=1;
for i=1:100
X(i+1)=sin(x(i));
end
disp(x(100))
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
Dennis le 1 Août 2018
I was thinking exactly the same and even edited it. Then i realised that we display x and not X.
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))

Connectez-vous pour commenter.

Catégories

En savoir plus sur Parallel Computing Toolbox dans Centre d'aide et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by