From: subbu on 5 May 2010 19:44 I have the following 3 sets of files in .mat format X1 X2 X3 ...... I loaded all of them and i want to do the following t1=X1(:,2)./1000; t2=X2(:,2)./1000; t3=X3(:,2)./1000; x1=-X1(:,4)*0.001; x2=-X2(:,4)*0.001; x3=-X3(:,4)*0.001; tr11=t1-(x1./vr); tr21=t2-(x2./vr); tr31=t3-(x3./vr); can some one help me how to do it when i have 100's of files. Thank you in anticipation cheers
From: Nathan on 5 May 2010 20:23 On May 5, 4:44 pm, "subbu " <ysr...(a)yahoo.com> wrote: > I have the following 3 sets of files in .mat format > X1 > X2 > X3 ...... > > I loaded all of them and i want to do the following > t1=X1(:,2)./1000; > t2=X2(:,2)./1000; > t3=X3(:,2)./1000; > > x1=-X1(:,4)*0.001; > x2=-X2(:,4)*0.001; > x3=-X3(:,4)*0.001; > > tr11=t1-(x1./vr); > tr21=t2-(x2./vr); > tr31=t3-(x3./vr); > > can some one help me how to do it when i have 100's of files. > Thank you in anticipation > cheers Don't load them into variables like that. See the Matlab FAQ 4.6: http://matlabwiki.mathworks.com/MATLAB_FAQ#How_can_I_create_variables_A1.2C_A2.2C....2CA10_in_a_loop.3F When you load your files into a cell array, then you can use a for loop to go through and process each cell as you do above. (Note: Use {} (braces) to get the value within a certain cell) -Nathan
|
Pages: 1 Prev: Moving columns below other columns, in a matrix Next: function error |