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 views (last 30 days)
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);

Answers (1)

Geoff Hayes
Geoff Hayes on 26 Apr 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 Comments
Geoff Hayes
Geoff Hayes on 26 Apr 2019
Edited: Geoff Hayes on 26 Apr 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...

Sign in to comment.

Products

Community Treasure Hunt

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

Start Hunting!