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);
0 件のコメント
回答 (1 件)
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
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 Center および File Exchange で Annotations についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!