Strange error with plot
Show older comments
I came across a curious error and I'm trying to figure out why this is happening.
I have a vector, date, and a 3-D array, TimePortStats. I'm trying to plot this:
plot(date(t_reg+1:end), TimePortStats(t_reg+1:end,j,k));
But I get this error:
Error using plot
Not enough input arguments.
Now instead, if I do this:
date(t_reg+1:end);
TimePortStats(t_reg+1:end,j,k);
plot(date(t_reg+1:end), TimePortStats(t_reg+1:end,j,k));
It plots fine. Why?
1 Comment
Satyajeet Sasmal
on 13 Aug 2015
Hi Jiann,
Are you running these lines in a script or in the Command window? I tried something similar and it runs fine for me. I was not able to reproduce the error.
date = rand(1,5);
TimePortStats = rand(5,5,5);
t_reg = 1;
j = 2 ;
k = 3 ;
plot(date(t_reg+1:end), TimePortStats(t_reg+1:end,j,k));
You can see the Figure plot made by running the above code, attached here.
Can you post the M files and/or data, that you are using, so that we can take a better look at this error and try to reproduce it?

Answers (0)
Categories
Find more on Annotations 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!