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

3 vues (au cours des 30 derniers jours)
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);

Réponses (1)

Geoff Hayes
Geoff Hayes le 26 Avr 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 commentaires
Geoff Hayes
Geoff Hayes le 26 Avr 2019
Modifié(e) : Geoff Hayes le 26 Avr 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...

Connectez-vous pour commenter.

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by