Borrar filtros
Borrar filtros

What is wrong with the following script?

2 visualizaciones (últimos 30 días)
Fred
Fred el 27 de Sept. de 2013
Comentada: Yash el 27 de Sept. de 2013
x(1) = 0; i = 1; y(1) = 1.1;
while x(i) <= 1.0
%x(i)= i;
x(i+1) = x(i) + 0.1;
y(i+1) = y(1) - m*x(i+1);
i = i+1;
end
plot(x,y,'r')
  2 comentarios
Jan
Jan el 27 de Sept. de 2013
Editada: Jan el 27 de Sept. de 2013
@Fred: Please do not post multiple questions for the same problem. This confuses the readers and wastes their time, when they post an answer which has been given before in another thread.
Whenever you explain in the forum, that there is a problem, explain it explicitly: Do you get an error message (post a complete copy of the message) or do the results differ from your expectations (explain both, we cannot guess these details).
Yash
Yash el 27 de Sept. de 2013
undefined m

Iniciar sesión para comentar.

Respuestas (2)

Azzi Abdelmalek
Azzi Abdelmalek el 27 de Sept. de 2013
m is not defined

Image Analyst
Image Analyst el 27 de Sept. de 2013
You have not defined m. Define m to be something and then it works (I tried it). The error message tells you that. Did you not see the error message?

Categorías

Más información sobre MATLAB en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by