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
|
|
0
|
|
|
|
Reply
|
subbu
|
5/5/2010 11:44:04 PM |
|
On May 5, 4:44=A0pm, "subbu " <ysr...@yahoo.com> wrote:
> I have the following 3 sets of files in .mat format
> X1 =A0 =A0 =A0
> X2 =A0
> X3 =A0 =A0...... =A0 =A0 =A0 =A0 =A0 =A0
>
> I loaded all of them and i want to do the following
> t1=3DX1(:,2)./1000; =A0
> t2=3DX2(:,2)./1000;
> t3=3DX3(:,2)./1000; =A0
>
> x1=3D-X1(:,4)*0.001;
> x2=3D-X2(:,4)*0.001;
> x3=3D-X3(:,4)*0.001;
>
> tr11=3Dt1-(x1./vr); =A0 =A0 =A0
> tr21=3Dt2-(x2./vr); =A0 =A0
> tr31=3Dt3-(x3./vr); =A0
>
> 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
|
|
0
|
|
|
|
Reply
|
Nathan
|
5/6/2010 12:23:17 AM
|
|