Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Read text and save it in an array (MatLab)

juancmr1juancmr1 Posts: 1Member
Hi I hope somebody can give an advice,

I am working in a Matlab programm, I need to read a textfile with 3 columns separated with a "," like this:

4.217,211.08,158.46
4.312,206.76,156.01
4.406,207.72,155.13
4.500,203.93,151.74
4.626,204.13,150.90
4.721,200.81,147.04

Once I read the data I need to save it in an array (Matrix),
I am first trying to read a text file (5 colulmns) separated by a blank space and then modify it in order to recognize the " ," as the previous example.

1. I am running the attached m file but I got the same error message:
??? Subscripted assignment dimension mismatch.

Error in ==> GetData1 at 42
f(k,j)=str2num(tx);
Any recomendation??

2. How can I modify it in order to read and save the text file but now separated by a comma "," ????

Thank you very much

Sign In or Register to comment.