Problem with a yyaxis plot
8 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Bryan Andrade Andrade
el 13 de Dic. de 2019
Hi, i need your help: i´m trying to plot this code:
x = linspace(0,25); y = sin(x/2); yyaxis left plot(x,y);
I found this code in mathworks help, i dont know why i can´t run it. The error says:
Error using yyaxis
Axes argument must be a Cartesian Axes of type matlab.graphics.axis.Axes
Help me please.... how i could fix it? its my matlab problem or the code is wrong i don´t know help me...
0 comentarios
Respuesta aceptada
Adam Danz
el 13 de Dic. de 2019
Editada: Adam Danz
el 17 de Dic. de 2019
You're missing a semicolon
x = linspace(0,25); y = sin(x/2); yyaxis left; plot(x,y);
% here ^
Or, better yet, use separate lines which greatly increases readability and error detection.
x = linspace(0,25);
y = sin(x/2);
yyaxis left %no semicolon needed this time
plot(x,y);
The error message appeared becaues Matlab interpreted your code as providing an axes input: yyaxis(ax,___)
0 comentarios
Más respuestas (0)
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!