I am writing data as matrices into excel file using Matlab. My matrices\' dimension varies and I don\'t know the matrices\' dimension in advance. Let\'s say I have matrix A,
You could try something like:
cellVector= ['A2';'B2';'C2';'D2';'E2']; %...etc as many as you need
cellstart = 'B2';
cellVectorLoc = find(cellVector == cellstart(1)); % Finds where B is located in cellVector
xlswrite('My file.xls',A,'My Sheet',cellstart);
nextCellLoc = length(A) + cellVectorLoc + 1; % length of A plus location in index + 1 for blank column. I can't remember if you should use length() or size().
newIndex= cellVector(nextCellLoc,:); % new index
xlswrite('My file.xls',B,'My Sheet',newindex);
Just be aware, this won't work for cells after column Z, because, for example, cellVectorLoc = find(cellVector == cellstart(1)); will find two locations in cellVector for column 'AA'.
Also, I can't remember if length(A) or which element of size(A) refers to the number of columns in A. Play around with the other one if length(A) doesn't give you the correct number of cols.