So I have the following script:
clc;clear;LM = xlsread('LagrangeMultiplier.xlsx','LM');CM = xlsread('LagrangeMultiplier.xlsx','CM');DT = xlsread('LagrangeMultiplier.xlsx','DT');for i = 1:size(LM,2) JPD(i,:) = exp(-1-sum(LM(:,i)))*mvncdf(DT, Inf*ones(size(DT,1),1),0,CM);end
Basically I have datafiles named:
LagrangeMultiplier1.xlsxLagrangeMultiplier2.xlsxLagrangeMultiplier3.xlsx
and so on until LagrangeMultiplier100.xlsx
Currently I'm running this script manually for each file, ie, I have LagrangeMultiplier1.xlsx as the name in the script, then I copy the values from the JPD workspace into excel, then put LagrangeMultiplier2.xlsx as the datafile name and so on. How can I automate this so that MATLAB automatically runs the script for all 100 datafiles and stores all 100 arrays for JPD into the workspace?
Thanks
Best Answer