Number of columns on line 2 of ASCII file [ ].m must be the same as previous lines.

1 回表示 (過去 30 日間)
Vu Tuan Long
Vu Tuan Long 2017 年 9 月 18 日
コメント済み: Lenny C 2022 年 4 月 8 日
Here is my code:
figure;
t = linspace(0,2*pi,100);
plot(t,sin(t));
hold on;
plot(t,cos(t),'--');
xlabel('x');
ylabel('function value');
legend('sin(x)','cos(x)');
xlim([0 2*pi]);
ylim([-1.4 1.4])
I get the above message when using load [].m, while it runs well when copied to the workspace.

回答 (1 件)

Henry Giddens
Henry Giddens 2017 年 9 月 18 日
If you just want to run that code, which is contained in a script, just type the name of the .m file without the 'load' command

カテゴリ

Help Center および File ExchangeEnvironment and Settings についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by