MATLAB: Obtaning a matrix with the right indexes

matrix indexes loop

My question:
A want to obtain a matrix A(4xN)=[A11 A21 A31 A41; A12 A22 A32 A42; …; A1N A2N A3N A4N].
So I think that I have to do something like this:
syms A1 A2 A3 A4;
N=10; %for example
A=sym(zeros(4,N));
B=sym(zeros(4,N));
for i=1:N
A(:,i)=[A1; A2; A3; A4]
end
for j=1:N
B(:,j)=[j; j; j; j]
end
C=char(A)
D=char(B)
%And now I have to do a concatenation:
E=strcat([C,D])
%But this won't work of course and I don't know if some part of my program is correct or there is a different approach for this.
Thank you for your atention.

Best Answer

Which MATLAB version are you using? If you are using R2011b or later, try just
A = sym('A', [4 N]);