What is wrong with the following script?

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

Jan
Jan 2013년 9월 27일
편집: Jan 2013년 9월 27일
@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 2013년 9월 27일
undefined m

댓글을 달려면 로그인하십시오.

답변 (2개)

Image Analyst
Image Analyst 2013년 9월 27일

0 개 추천

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?

카테고리

도움말 센터File Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

태그

질문:

2013년 9월 27일

댓글:

2013년 9월 27일

Community Treasure Hunt

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

Start Hunting!

Translated by