I need help to convert ascii data matrices to complex data matrices

Dear All,
I need some help to convert data stored in a file that is in ascii format. The data I have looks like as below:
{{'1930+5263i<E>' '3930+5563i<E>' '1930+5263i<E>' '3930+5563i<E>'} {'1930+5263i<E>' '3930+5563i<E>' '1930+5263i<E>' '3930+5563i<E>'}}
What I want to do is convert this to a cell matrix containing of matrix whis in turn contain of complex valued data as given below:
{[1930+5263i 3930+5563i 1930+5263i 3930+5563i] [1930+5263i 3930+5563i 1930+5263i 3930+5563i]}
I have tried to do a parser based on state machine that remove '<E>' but I stucked in my mind so I wonder if there is some simple method to do that with matlab commands.
Thanks and all the best,
Michael Numminen

Answers (2)

z ={{'1930+5263i<E>' '3930+5563i<E>' '1930+5263i<E>' '3930+5563i<E>'} {'1930+5263i<E>' '3930+5563i<E>' '1930+5263i<E>' '3930+5563i<E>'}}
cellfun(@(x)str2double(regexprep(x,'<E>','')),z,'un',0)

Categories

Products

Asked:

on 18 Nov 2011

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!