フィルターのクリア

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 Center および File ExchangeGeneral Applications についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by