why am i getting an error for counts in histogram?
2 views (last 30 days)
Show older comments
I am trying to display the counts in my histogram, but I keep getting an error message stating 'Too many output arguments'.
Speed = HPperformance(:,23);
[n,x] = histogram(Speed.GPSSpeed_knots_);
h.BinEdges = [1:20];
barstrings = num2str(n');
text(x,n,barstrings,'horizontalalignment','center','verticalalignment','bottom')
0 Comments
Answers (1)
Image Analyst
on 24 Mar 2018
What kind of variables are HPperformance and Speed? Apparently Speed is a structure. Is HPperformance a structure array? If so, Speed would be a column vector of structures. Since I don't really know what these variables are (yet), about all I can suggest is to try to concatenate the values:
histogram([Speed.GPSSpeed_knots_]);
2 Comments
Image Analyst
on 24 Mar 2018
You didn't answer my question. I don't think they are databases. If you do this:
whos HPperformance
whos Speed
What do you see in the command window when these execute? I don't think it will say that they're "databases" it will say a regular MATLAB variable type like structure, cell array, double, or whatever. Please do that, then read this link first and then paste ALL THE RED TEXT of your error message.
See Also
Categories
Find more on Histograms 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!