kollurulp
Mechanical
- Apr 2, 2004
- 12
I want to read the values from a file which is the following format into a matrix
@ STAGE_X_MIRROR
No 0 Pos_y -234mm Wx 10 Wxp 3
No 1 Pos_y -232mm Wx 8 Wxp 2
No 2 Pos_y -230mm Wx 8 Wxp 2
No 3 Pos_y -228mm Wx 8 Wxp 2
@ STAGE_Y_MIRROR
No 0 Pos_x -164mm Wy -32 Wyp -2
No 1 Pos_x -162mm Wy -35 Wyp -2
No 2 Pos_x -160mm Wy -34 Wyp -2
No 3 Pos_x -158mm Wy -33 Wyp -2
I need only the values Pos_y, Wx and Wxp and the next will be Pos_x, Wy and Wyp. That is the output of the matrices should be
matrix 1
-234 10 3
-232 8 2
-230 8 2
matrix 2
-164 -32 -2
-162 -35 -2
i coded to read from the file skip the first line then i said
data(iData,1:3) = sscanf(strLine,'%*s %*d %*s %g %*s %d %*s %d')'; - by this statement it was reading -234 in all the three.
please inform me if someone can do this even by anyother possible way also
@ STAGE_X_MIRROR
No 0 Pos_y -234mm Wx 10 Wxp 3
No 1 Pos_y -232mm Wx 8 Wxp 2
No 2 Pos_y -230mm Wx 8 Wxp 2
No 3 Pos_y -228mm Wx 8 Wxp 2
@ STAGE_Y_MIRROR
No 0 Pos_x -164mm Wy -32 Wyp -2
No 1 Pos_x -162mm Wy -35 Wyp -2
No 2 Pos_x -160mm Wy -34 Wyp -2
No 3 Pos_x -158mm Wy -33 Wyp -2
I need only the values Pos_y, Wx and Wxp and the next will be Pos_x, Wy and Wyp. That is the output of the matrices should be
matrix 1
-234 10 3
-232 8 2
-230 8 2
matrix 2
-164 -32 -2
-162 -35 -2
i coded to read from the file skip the first line then i said
data(iData,1:3) = sscanf(strLine,'%*s %*d %*s %g %*s %d %*s %d')'; - by this statement it was reading -234 in all the three.
please inform me if someone can do this even by anyother possible way also