Oooh, just seen using readlines gives a string array. So can use this:
pat = digitsPattern
newStr = extract(Str,pat)
But it falls over with the E here "Horizontal Scale,2.000E-04"
l=readlines(fullpath);
Key = 'Memory Length';
line_idx=find(startsWith(l,Key))
Str=l(line_idx)
pat = digitsPattern
MemoryLength = str2double(extract(Str,pat))
Mem_Million=MemoryLength/(10^6)
Key='Horizontal Scale';
line_idx=find(startsWith(l,Key))
Str=l(line_idx)
pat = digitsPattern
H_Scale = str2double(extract(Str,pat))
Str =
"Horizontal Scale,2.000E-04,"
pat =
pattern
Matching:
digitsPattern
H_Scale =
2
0
4