Why am I getting "Invalid first data argument"

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"?

 Respuesta aceptada

Star Strider
Star Strider el 29 de Sept. de 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.

Más respuestas (0)

Categorías

Más información sobre Line Plots en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 29 de Sept. de 2016

Respondida:

el 29 de Sept. de 2016

Community Treasure Hunt

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

Start Hunting!

Translated by