Hi,
Currently, I'm trying to arrange my data in .txt. file of certain column in an .xls file.
But I got this error, as the dimension of each selected column of the .txt file are not similar.
Error using horzcat
Dimensions of arrays being concatenated are not consistent.
I plan to assign NaN to the empty cell to obtain similar dimension of each data.
What are the best solution for this problem?
Attached herewith the .txt. file and command I had tried.
S1 = importdata ('s1.txt');
GRFX1 = S1.data(:,2);
GRFY1 = S1.data(:,3);
GRFZ1 = S1.data(:,4);
S2 = importdata ('S2 0.txt');
GRFX2 = S2.data(:,2);
GRFY2 = S2.data(:,3);
GRFZ2 = S2.data(:,4);
S_1 = [GRFX1,GRFY1,GRFZ1];
S_2 = [GRFX2,GRFY2,GRFZ2];
GRFX=[GRFX1, GRFX2];
GRFY=[GRFY1, GRFY2];
GRFZ=[GRFZ1, GRFZ2];
N = [S_1, S_2];
GRF = [GRFX, GRFY, GRFZ];
Thank you in advance!