yline error for Matlab example

조회 수: 6 (최근 30일)
Cakil
Cakil 2023년 1월 18일
댓글: Star Strider 2023년 1월 18일
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');
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');
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.

채택된 답변

Star Strider
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
built-in (/MATLAB/toolbox/matlab/graphics/primitive/line) /MATLAB/toolbox/coder/half/@half/line.p % half method
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
If that still does not solve the problem, Contact Support.
.
  댓글 수: 2
Cakil
Cakil 2023년 1월 18일
Hello @Star Strider, thank you for your support.
Not
which line -all
but
restoredefaultpath
rehash toolboxcache
solved my problem.
Thanks a lot!
Star Strider
Star Strider 2023년 1월 18일
As always, my pleasure!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Entering Commands에 대해 자세히 알아보기

태그

제품


릴리스

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by