plot, Invalid first data argument
Show older comments
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
Answers (1)
Sean de Wolski
on 21 Feb 2013
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 Comments
Bum
on 21 Feb 2013
Sean de Wolski
on 21 Feb 2013
so what does that look like?
Precip{PrecipNo}
Is that something you would expect to plot?
Bum
on 21 Feb 2013
Sean de Wolski
on 21 Feb 2013
What is the output from the above - at the command line!!
Is it a vector, matrix, empty, string, object of class Sean, etc.?
Bum
on 21 Feb 2013
Sean de Wolski
on 22 Feb 2013
I don';t know. What does it look like as a char?
Categories
Find more on Line Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!