Can someone help me with the following error?
Index exceeds matrix dimensions.Error in Lateral_Position (line 28) eval(sprintf('x=[TP%d_BaseLine(:,2)]',i));_________________________________________________________________%%Load Data
filenames = {'TP2_BL.mat','TP3_BL.mat','TP4_BL.mat','TP5_BL.mat','TP6_BL.mat','TP7_BL.mat','TP8_BL.mat','TP9_BL.mat','TP10_BL.mat','TP11_BL.mat','TP12_BL.mat','TP13_BL.mat','TP14_BL.mat','TP15_BL.mat','TP16_BL.mat','TP17_BL.mat','TP18_BL.mat','TP19_BL.mat'}; for kk = 1:numel(filenames) load(filenames{kk})enddisp('Cell data BL loaded')disp('-------------------------------------------------------------------')Ldist=[];for i=2:19 eval(sprintf('x=[TP%d_BaseLine(:,2)]',i)); Ldist=[Ldist;x];endRdist=[];for i=2:19 eval(sprintf('x=[TP%d_BaseLine(:,4)]',i)); Rdist=[Rdist;x];end
Best Answer