write a function that iterates through a text file and reads in each line in a new array in matlab
main.m
functionlinesArray = readTextFile(filename) fid = fopen(filename, 'r');
linesArray = {};
if fid == -1 error('Cannot open file');
end line = fgetl(fid);
while ischar(line)
linesArray = [linesArray; line];
line = fgetl(fid);
end fclose(fid);
end