필터 지우기
필터 지우기

New to MATLAB...can't find what's wrong in this code....

조회 수: 1 (최근 30일)
Gowri Kurup
Gowri Kurup 2011년 8월 14일
편집: Walter Roberson 2016년 9월 23일
a=2;
x=0.5;
for i=1:1000
{
plot(i,x);
x = a*x-a*x.^2);
}
end
I'm trying to plot a logistics map....but I keep getting the error: "The expression to the left of the equals sign is not a valid target for an assignment."
Can someone help me?
  댓글 수: 1
Yoav Livneh
Yoav Livneh 2011년 8월 14일
You don't need to put the code in the for loop inside curly braces. Also you have a ")" that dosn't belong on "x = a*x-a*x.^2);"
What are you trying to do? Are you trying to plot all 1000 values of x together? Because in your code each iteration of the for loop will overwrite the previous plot.

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

채택된 답변

Muhammad shahbaz
Muhammad shahbaz 2011년 8월 14일
the '{}' should be removed,nothing else is wrong,go on with it.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 General Applications에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by