For context, the full code reads data from a text file, calibrates and converts the data to degrees, and then saves the new data in 4 columns with 108766 rows each. This is what I am currently using to save the new text file:
function calibratedData = applyCal(fname,Ey,components,rawData,Calib)% applies calibration (gain and shift) to raw data; function returns
% calibrated data ONLY for 'components'!
calibratedData = [];for i = find(components) calibratedData(:,Ey(i).datacolumn) = ( rawData(:,Ey(i).datacolumn) - Calib(1,Ey(i).datacolumn) ) * Calib(2,Ey(i).datacolumn);end%save as textfile:
s = strtok(fname,'.');SaveName = [s, datestr(now, ' yyyymmddTHHMMSS'),' calibrated.txt'];save (SaveName, 'calibratedData', '-ASCII');end
This works – but I need there to be a header at the top of each column. The headers need to be "LE Horizontal" "LE Vertical" "RE Horizontal" and "RE Vertical". Any help would be appreciated! Thank you!
Best Answer