Hello,
I want to label an n-by-m matrix dynamically using horzcat. I'm using the following code:
X=[];for i=1:size(tableau,1) X=[X strcat('x', num2str(i))];endY=[];for j=1:size(tableau,2) Y=[Y strcat('y', num2str(j))];endt=horzcat({''; strcat('', X) ;'M'}, ... vertcat({ strcat('', Y),'N'},... num2cell(tableau)));
However I'm getting an error "??? Error using ==> vertcat CAT arguments dimensions are not consistent."
The objective is to obtain the following output regardless of the matrix size:
'' 'y1' 'y2' 'y3''x1' 5 5 3'x3' 3 1 3'x3' 7 6 4
Thanks for your help.
Best Answer