Basically, I have 10 data files, and I wrote a MATLAB function to process this data. The code looks like this:
function Z = fitdata(file_path)
A = importdata(file_path,',');
...
end
Since I do not want to enter the same command 10 times (for different file names), I wrote another script to automate this processing. The code is as follows:
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 get the error "Too many input arguments" when calling the function fitdata (file_path).
How can I do it?
source
share