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 次查看(过去 30 天)
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);

回答(1 个)

Geoff Hayes
Geoff Hayes 2019-4-26
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 个评论
Geoff Hayes
Geoff Hayes 2019-4-26
编辑:Geoff Hayes 2019-4-26
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...

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Annotations 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by