I'm working in a matlab script that open a group of text files and read their content. The content is XY double points, separated by " ". I save the readed values in a Array like this:
dataArray= textscan(fileID, formatSpec, 'Delimiter', delimiter, 'MultipleDelimsAsOne', true, 'EmptyValue' ,NaN, 'ReturnOnError', false);
This work fine but problems appear when i open multiple files because put the data in a array od data. Here the code and example:
for i = 1:length(files)
%% Open the text file.
fileID = fopen([path files{i}],'r');
dataArray = cat(1, dataArray, textscan(fileID, formatSpec, 'Delimiter', delimiter, 'MultipleDelimsAsOne', true, 'EmptyValue' ,NaN, 'ReturnOnError', false));
end
%% Close the text file.
fclose(fileID);
end
The result of this is:
Where each cell is
I want that all values appear continuous like in the second picture. What i'm doing wrong?

