开发者

Calling another script file in MATLAB

开发者 https://www.devze.com 2023-04-07 09:01 出处:网络
I am having a problem with calling another script from within a script. I run a script \"a.m\" and it uses a function detailed in another script \"b.m\", and within开发者_开发技巧 \"b.m\" there is an

I am having a problem with calling another script from within a script. I run a script "a.m" and it uses a function detailed in another script "b.m", and within开发者_开发技巧 "b.m" there is an if clause which is supposed to rerun "a.m" given a certain condition is fulfilled. However, when trying to write this if clause and calling "a.m", i get this error:

Undefined variable "a" or class "a.m".

% My "if" clause in b.m looks like this:
if numel(xyz) == 0
    a.m;
end

Why am I getting this error, considering it's "a.m" that I initially run?


The syntax is wrong. You call it as a not a.m.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号