I am trying to write a program that runs multiple samples but I can not figure out how to load a different sample for each iteration of the for loop.
For example:
sample1='/home/examplefilename.DTA';sample2='/home/examplefilename2.DTA';sample3='/home/examplefilename3.DTA';q = inputdlg('How many samples were loaded?');nsamples = str2double(q);for h=1:nsamples; [xd,yd,Pars]=eprload(sample(h)); xIndex = find(yd==max(yd(xd>=2600 & xd<=2850)), 1, 'first'); B = xd(xIndex); v=Pars.MWFQ; disp(sample(h))end
This gives me the error message 'Undefined function or variable 'sample'.
Best Answer