Basically, I have 10 data files and I wrote a MATLAB function to process these data. The code is like this:
function Z = fitdata(file_path)
A = importdata(file_path,',');
...
end
Since I don't want to input the same command 10 times (for different file names), I wrote another script to automate this processing. The code looks like this:
function X = automate()
myarray = {'file_one', 'file_two', 'file_three',......,'file_ten'};
for i = 1:9
mypath = myarray{i};
W = fitdata(mypath);
...
end
end
But I'm getting the error "Too many input arguments" at the call to the fitdata(file_path) function.
How should I do this?