So I've ha a txt file that starts off with a few lines of text contianing both characters and numbers e.g. seen in text.txt, so I only included one row of data, but it has over 600 rows, which is the data I want to work with.
I have a hard time to finding a way to read/open/load the file and to seperate the unnecesary information from the data that I want to work with. Any tips on how to move forward?
[filename path] = uigetfile([files.path '*.txt; *.inp'],'Choose file');
data = load_data(filename);
So I tried with
function [data] = load_data(filename)
lines = cellfun(@strtrim, regexp(S, '\r?\n', 'split'),'UniformOutput', 0);
values = cellfun(@(s) cell2mat(textscan(s, '')), lines, 'uniform', 0);
mask = cellfun(@isempty, values);
values(mask) = lines(mask);
Since I have no idea how to start, and it obviously doesn't work..