I was not sure which title fits better in my case so I just left it to be written in the most general way. I have the file with following structure:
Step 1
0.10190103
0.10145140
0.10097524
0.10050153
0.10003042
9.95795131E-02
9.91610140E-02
Step 2
9.81189385E-02
9.75561813E-02
9.80424136E-02
0.10000000
0.10000000
9.80617628E-02
9.77829769E-02
...
Step N
0.10000000
0.10000000
9.93788019E-02
0.11977901
0.12290157
0.12588248
0.12861508
And I need to read it from N arrays, so
V1 = [0.10190103
0.10145140
0.10097524
0.10050153
0.10003042
9.95795131E-02
9.91610140E-02]
V2 = [9.81189385E-02
9.75561813E-02
9.80424136E-02
0.10000000
0.10000000
9.80617628E-02
9.77829769E-02]
VN = [0.10000000
0.10000000
9.93788019E-02
0.11977901
0.12290157
0.12588248
0.12861508]
I have read some examples to read data into arrays, but have not got something related to my case...
Can someone help me please..?
My Try
d = readtable('whole res.txt'); % name of file
d = table2cell(d);
d = regexprep(d,' ','');
d = cellfun(@str2double,d,'uni',0);
d(cellfun(@isnan,d)) = [];
d = reshape(cell2mat(d),12,[]); % 12 - is values number
But still does not work. Traceback:
Error using readtable (line 143)
Reading failed at line 2. All lines of a text file must have the same number of delimiters. Line 2 has 4
delimiters, while preceding lines have 1.
SAMPLE FILE
Step 1
0.10000000
0.10000000
0.10000000
0.10000000
0.10000000
0.10000001
0.10000001
0.10000001
0.10000000
0.10000001
0.10000001
0.10000001
Step 2
0.10000000
0.10000000
0.10000000
0.10000000
0.10000000
0.10034978
0.10070127
0.10070127
0.10000000
0.10000001
0.10000001
0.10000001
PrintScreen
