|
"BHUPALA" <bhupala@gmail.com> wrote in message
news:09744d62-04cb-4543-bb3a-95b45c87d0ac@x6g2000prc.googlegroups.com...
> Dear friends,
>
> can you help me in creating n x n symbolic matrix like
>
> [a11 a12 ... a1n]
> [a21 a22 ... a2n]
> A = [ ... ]
> [an1 an2 ... ann ]
>
> Can anybody help me?
>
> Regards.
>
> Bhupala.
A = sym(zeros(n, n));
for rows = 1:n
for cols = 1:n
A(rows, cols) = sym(sprintf('a%d%d', rows, cols));
end
end
You should watch out if you want to create a moderately sized matrix like
this -- is a111 element (1, 11) of A or element (11, 1)? I would personally
use some separator between the row and column components of the sym variable
name.
--
Steve Lord
slord@mathworks.com
comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ
|