MATLAB Answers


Read a txt file and put in different matrices different parts of it

Asked by Emmanouil Margaronis on 18 Jun 2013

you have a txt that looks like this: FILE 001 CH-1:00.00, 08F4,0811,0837,0702,05FF,065E,0700,0731,0936,0A9B,08AC,073C,0814 08D5,0710,05F9,0715,07B1,0866,0889,08BE,09EC,0871,0711,0765,0707 063E,0777,0805,093C,08BC,08DC,08FC,08F5,077A,0796,075B,0758,06C5 07A5,0865,08FC,09EC,09B0,07D5,05DC,06EF,08D7,0946,061C,0616,09B5 0C10,097B,06A0,06E4,0876,06D2,05F8,06D5,07A6,08E4,097C,0A01,0946 FILE 002 CH-2:00.00, 0170,0563,0568,0579,0573,0583,05C9,05C8,0551,04F3,04EB,0503,04FA 04CA,048F,04CF,04F4,04D5,04AD,0476,0452,0454,046E,0443,0455,0491 04C3,04D0,04E9,04EC,04EA,04DD,04CE,04EC,053E,0555,0543,0548,055C 0555,053C,050F,04E2,04DB,04CD,04C5,04C5,04DD,04E9,04C6,0485,0452 043E,040E,03F0,03E0

and i want to put file 1 in a matrix and file 2 in another matrix.Please help

  1 Comment

Other than splitting the file at the FILE XXX markers, what other information in the file do you want to retain? For example, what to do with the CH-1:00.00 field? What is the size and type of the matrices? Do you convert from hex to double or no?

Please provide example output of what you want the matrices to look like.

Log in to comment.


0 Answers

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Win prizes and improve your MATLAB skills

Play today