user718531
user718531

Reputation: 261

Calling another script file in MATLAB

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?

Upvotes: 1

Views: 2319

Answers (1)

Nzbuu
Nzbuu

Reputation: 5251

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

Upvotes: 4

Related Questions