i get error using plot and error in color/lineup and i don't know what to do i have already attached the file if someone wanna see i want my program to run and show the high pass plot
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
i keep on getting this error saying error even after trying many times using plot and i dont know whats the problem it says
Error using plot
Error in color/linetype argument.
Error in matlabreport>pushbutton2_Callback (line 162)
plot(f,h);
0 comentarios
Respuestas (1)
Geoff Hayes
el 26 de Abr. de 2019
Mohammad - your attached file does not include the pushbutton2_Callback nor do I see any reference to an f or h. I can reproduce your error with this code
>> plot(1:10, 'hello')
where the second input, the string 'hello', is not a valid color or linetype argument. I suspect that you have the same problem with your h variable. What is it set to?
3 comentarios
Geoff Hayes
el 26 de Abr. de 2019
Editada: Geoff Hayes
el 26 de Abr. de 2019
When I run the above code (with some dummy inputs), h becomes a 1x1 char with a value of '0' and so the plot function thinks that it should be a colour or line type. The code to set h is as follows
h=((s.*n.*str2double(c))/(1+(s.*n.*str2double(c))));
h=num2str(h);
Why are you converting it to a string with num2str? If I remove this line then h remains as an array and something is drawn on the axes...
Ver también
Categorías
Más información sobre Annotations en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!