Why am I getting "Invalid first data argument"
2 views (last 30 days)
Show older comments
kelsey young
on 29 Sep 2016
Answered: Star Strider
on 29 Sep 2016
I am trying to plot the following.
s = {Fun_WS1; Fun_WS2; Fun_WS3; Fun_WS4; Fun_WS5; Fun_WS6; Fun_WS7; Fun_WS8; Fun_WS9; Fun_WS10};
h=[0:10];
semilogy(s,h);
I have all the Fun_WS values defined in the workspace (shown in the attached .PNG).
Why am I getting "Invalid first data argument"?
0 Comments
Accepted Answer
Star Strider
on 29 Sep 2016
Try this:
s = [Fun_WS1; Fun_WS2; Fun_WS3; Fun_WS4; Fun_WS5; Fun_WS6; Fun_WS7; Fun_WS8; Fun_WS9; Fun_WS10];
h=[1:10];
semilogy(s,h)
Using a cell array here is inappropriate. Use a regular vector instead. Also, ‘s’ has 10 elements, ‘h’ originally had 11. I corrected that.
NOTE — Since I do not have your original data, only the image, this is UNTESTED CODE. It should work.
0 Comments
More Answers (0)
See Also
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!