yline error for Matlab example
8 次查看(过去 30 天)
显示 更早的评论
Hello Matlab Community,
I am having trouble to use yline command. Even if I try the matlab example, I receive the below error:
Code for example from yline documentation:
fplot(@(x) log(x));
xlim([0 15]);
ylim([0 4]);
yline(3,'-','Threshold');
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1267635/image.png)
Addition to my question, I also tried the xline example and received a similar error. The link of example from xline documentation:
xline(5,'--r');
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1267695/image.png)
What can I do to fix my line problem?
I am using matlab R2022b and it is newly updated.
Thank you in advance for your time and support.
0 个评论
采纳的回答
Star Strider
2023-1-18
First, you could have ‘overshadowed’ the line function somehow. To determine that, run this from a script or your Command Window:
which line -all
The result should be similar to the displayed result. If it says anything else (particularly ‘line is a variable’ or something similar) that could be the problem. The solution would be to re-name the user function or variable.
If that is not the problem, try running these from a script or your Command Window:
restoredefaultpath
rehash toolboxcache
.
2 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Startup and Shutdown 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!