plot, Invalid first data argument

6 ビュー (過去 30 日間)
Bum
Bum 2013 年 2 月 21 日
I cannot find what's the problem with the below code. It gives me invalid fist data argument erorr. I want to plot four graphs on one figure.
Case={'Obs', 'Q0', 'Q3', 'Q4'};
for i=1:4
load(sprintf('Monthly_Mean_Precip_%s.mat',Case{i}));
end
for j=1:4
Precip{j}=sprintf('Monthly_Mean_Precip_%s',Case{j});
end
Ncomponent = 4;
for PrecipNo=1:Ncomponent
figure;
plot(Precip{PrecipNo});
end

回答 (1 件)

Sean de Wolski
Sean de Wolski 2013 年 2 月 21 日
dbstop if error
Then run the above *.m file. It will stop with the debugger and you'll be able to investigate what is going on.
  7 件のコメント
Bum
Bum 2013 年 2 月 21 日
編集済み: Bum 2013 年 2 月 21 日
Is the error in plot is because of the class of 'Precip{PrecipNo}' is char? Then what shoud I have to do?
Sean de Wolski
Sean de Wolski 2013 年 2 月 22 日
I don';t know. What does it look like as a char?

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

カテゴリ

Help Center および File Exchange2-D and 3-D Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by