Get data points from one line
Show older comments
Hello
I have some data in the form
...
-> Parameter number 54 : Cell_C_ph1_pat1 4.4501491 ( +/- 0.72288327E-04 )
-> Parameter number 55 : Cell_A_ph1_pat1 11.445057 ( +/- 0.16855453E-03 )
-> Parameter number 56 : Cell_B_ph1_pat1 4.1313801 ( +/- 0.61447019E-04 )
-> Parameter number 57 : X-tan_ph1_pat1 0.33901680 ( +/- 0.41584419E-02 )
-> Parameter number 58 : V-Cagl_ph1_pat1 -0.20550521E-01( +/- 0.47112759E-02 )
-> Parameter number 59 : W-Cagl_ph1_pat1 0.20377478E-02( +/- 0.27476726E-03 )
-> Parameter number 60 : U-Cagl_ph1_pat1 0.18869112 ( +/- 0.19129461E-01 )
...
I'm trying to get the values after the name of the parameter(i.e. the 4.4501491 +/- 0.72288327E-04 at Cell_C_ph1_pat1), but i'm struggling a little with the regexp/strfind. At the moment, i have something looking like
buffer = fileread('SnSe_100K_17.out');
substr = '(?<=Cell_C_ph1_pat1\D*)\d*\.?\d+';
numbers = str2double(regexp(buffer,substr,'match'))
This just give the first value of Cell_C(4.4501491), and i would love to also get the error. Actually, if it's possible to get three vectors out - one with the name of the parameter, one with values, and one with errors, it would just be perfect!
I have a lot of data-files in one folder, so i think i would want to make a for-loop, getting all the data from the other files.
Accepted Answer
More Answers (0)
Categories
Find more on Characters and Strings in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!