Undefined function or variable 'xlim' Error

3 次查看(过去 30 天)
Hi.
All of a sudden I get the following error when running a function
Undefined function or variable 'xlim'.
Error in ba (line 50)
xlim([100 500])
I am using R2019a and have tried prior recomendations i found on the forum like the following:
restoredefaultpath
rehash toolboxcache
but this did not work. If i remove the
xlim([100 500])
line (line 50 in function) or change xlim to ylim then it runs fine.
Any help would be appreciated.

采纳的回答

Fangjun Jiang
Fangjun Jiang 2019-12-5
run"which -all xlim"?
  5 个评论
HpW
HpW 2019-12-5
Ack. i figured it out....
I must have accidently deleted something in my function declaration which should be
function [xlim_a, xlim_b] = ba(var1, var2)
the typo deleted the "_a" and made it:
function [xlim, xlim_b] = ba(var1, var2)
fixing the typo fixed the issue....thanks so much for your help!!
Probably good example to not name variables close to main matlab functions.....

请先登录,再进行评论。

更多回答(0 个)

类别

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

标签

产品


版本

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by