I have a text file with 1151 lines and each line is comma separated with 20 numbers, like this:
When I open a textfile with this code:
fid = fopen('assignment1.txt', 'r');
if fid == -1
disp('Error, check file name')
fmt = repmat('%f', 1, 20);
S = textscan(fid, fmt, 'Delimiter', ',', 'CommentStyle', '@');
I get a 1x20 cell array, where each entry is a 1151x1 double matrix.
I want it to be a 1x1151 cell array with 20x1 matrices instead. I want it that way because I need to randomly swap the positions of the rows between each other, not the columns.