Assume that I have a sampledata.mat array and I have to input it into a function myfun.
I have defined the function as below.
function myout = myfun(mydataset)
dataset = load(mydataset)
Then I used the following syntax to execute myfun with corresponding arguments.
DataOut = myfun('sampledata.mat')
When I try to execute this, I am getting an error message saying,
Reference to a cleared variable mydataset !
(Note that I am working on the same directory where both myfun.m and sample.mat are in)
Can anyone please help to find what is wrong over here.