Hello everyone,
I have written a function that imports .txt files and removes the 5 header lines. Right now the function only reads .txt files with 6 columns of data. I am trying to make this file more robust, so that it can read .txt files with any number of data columns up to say 12. I am not sure how to appproach this and was looking for some help in doing so. Here is my function:
function[data]=Load_Data(filename,strain_command_data)
FID=fopen(filename);data=textscan(FID,%f%f%f%f%f%f','HeaderLines',5,'CollectOutput',1);
fclose(FID);data=data{1}rows_remove=find(data(:,strain_command_data)==0);if (~isempty(rows_remove)),data=data(1:rows_remove(1)-1,:);end end
Any help would be great.
Best Answer