Hi, I am trying to use dlm write with two row header.(Datanames and headers) I made it for one row header. But For additional header it did not work? I could not write the second row header I would be pleased for any help.
% the data
fnam='stop3.txt'; % <data file
hdr={'Var_no','Acc','Dcc','Vcrs','Fcs','Vmax','Sure'}; % First header
hdr2={'No','m/s2','m/s2','km/h','kg', 'm/s','s'}; % Second Header
m=magic(7) %data
% the engine
txt=sprintf('%s\t %s\r\t',hdr{:},hdr2{:}); txt(end)=''; dlmwrite(fnam,txt,''); dlmwrite(fnam,m,'-append','delimiter','\t');% the result
type(fnam)
The first row is ok. Bur for secodn row..It did not work. The data should be formatted like this as tab delimited txt file.
Var_No Acc Dcc VCrs FCs Vmax sureNo m/s2 m/s2 km/h kg m/s s64 1,4 -2 40 0,145529778 11,46442127 5050 1,2 -2 40 0,15172966 11,46151161 6157 1,3 -2 40 0,151792581 11,49402332 6036 1 -2 40 0,15426373 11,43154716 61
Kind Regards. Orkun ÖZENER
Best Answer