I run a program, which is a function - here I'll call it 'myfxn' - that outputs several different variables. But when I try to access the data I get
??? Undefined function or variable 'myfxn'.
How do I access the data? Thanks for your help.
I run a program, which is a function - here I'll call it 'myfxn' - that outputs several different variables. But when I try to access the data I get
??? Undefined function or variable 'myfxn'.
How do I access the data? Thanks for your help.
Your question is a bit confusing - you claim you run the function, but then you also say that Matlab throws an error indicating it can't run the function.
Here's two things to test
myfxn
on the Matlab path? Run the command which myfxn
. If that does not find the function, change directory (using cd
or the directory browser on the Matlab Desktop) to where myfxn
is located. function [out1,out2] = myfxn(in1,in2)
, where in1
and in2
are two input arguments, and out1
and out2
are output arguments. Then, you could call myfxn
like this: [a,b] = myfxn(2,'something');
, and it will use the two inputs to generate the two outputs, which are assigned to a
, and b
, respectively.