Hi,
I need to import some datas from a file that is structured as follow:
Time1 (X11 Y11 Z11) (X12 Y12 Z12) ...
Time2 (X21 Y21 Z21) (X22 Y22 Z22) ...
...
Time_m (Xm1 Ym1 Zm1) (Xm2 Ym2 Zm2) ...
I would like to obtain a Time vector and 3 matrix X Y Z.
I've tried with textscan but the Time at the beginning gives me some problems: if I use as formatSpec '%f (%f %f %f)' it only reads the first 4 numbers, on the other hand if I use '(%f %f %f)' it does read anything.
I've managed to solve this in an horrible way:
formatSpec=('%f');
for i=1:nprobes
formatSpec=strcat(formatSpec,' (%f %f %f) ');
end
data=textscan(FileID,formatSpec,'HeaderLines',4);
This way I create a 3*N + 1 cell array that i need to merge as:
X=[data{2},data{5},data{8}...
Y=[data{3},data{6},data{9}...
Z=[data{4},data{7},data{10}...
but i don't know how to do it (since N is very big)...
Can you please help?
Thanks