X=zeros (1,1301);
time =0:0.05:65;
k=0.05;
for i=2:1301
X(i) = ((k*(0.293*X(i-1)^2)-(0.542*X(i-1))+0.354)*0.05) +X(i-1);
end
plot (time, X)
hold on
plot (timeopc25, alphaopc25,'--')
legend('Predicted Data','Experimental data');
It tells, not formed from a valid matlab identifier. What does this mean? Thanx in advance

4 件のコメント

Star Strider
Star Strider 2014 年 10 月 5 日
It runs until it gets to the second plot call.
Obvious question:
What are ‘timeopc25’, and ‘alphaopc25’?
Are they important to your question?
adrooney
adrooney 2014 年 10 月 6 日
Yes, those are vectors [581x1] and I need to compare the plot (time,X) to Plot (timeopc25, alphaopc25)
Star Strider
Star Strider 2014 年 10 月 6 日
We don’t have ‘timeopc25’, and ‘alphaopc25’ so we can’t help you with them.
adrooney
adrooney 2014 年 10 月 6 日
@Star Strider Please check my code and the graph just doesn't converge on the original graph. I have included the timeopc25 and alphaopc25 files too.

サインインしてコメントする。

 採用された回答

Bruno Pop-Stefanov
Bruno Pop-Stefanov 2014 年 10 月 6 日

6 投票

This error usually occur when there is a space in an M-file, or other forbidden characters. Check that the script file containing the code has a correct name with no white spaces.
This is incorrect: "my file.m"
This is correct: "myfile.m"

1 件のコメント

Anees kazi
Anees kazi 2015 年 8 月 14 日
It worked. Thank you.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File Exchange で MATLAB についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by