rawdata is a numeric matrix (size 2500×136 double)
text is a string matrix (size 2×136)
Text matrix contains the labels I want to add to the rawdata matrix. I double-checked the variable dimensions by using the size( ) function. Help?!?
error message:
Error using vertcat Dimensions of matrices being concatenated are not consistent. Error in openfile (line 25) labeled_data=[text; rawdata];
code:
%read the text file
fileID=fopen('Master_inventory.txt'); inventory=textread('Master_inventory.txt', '%s' ... , 'delimiter', '\n', 'whitespace', ''); % search for directory
c = cellstr(inventory); filedesired = 'M29AA216afc01c1asfh_0000.3LA'; indx = regexpcell(c,filedesired); %retrieve directory
pat = inventory(indx); path = cellstr(pat); %open file
raw=path{1}; rawdata=load(raw); %add column labels
filename = 'DC_labels.xls'; [data, text] = xlsread(filename,'A1:EF2'); text = cellstr(text); labeled_data=[text; rawdata];
Best Answer