How do I create a matrix consisting of symbol elements in MATLAB R2009b?
The tedious way of doing this would be:
syms a11 a12 a21 a22
A = [a11 a12; a21 a22]
But if I want a 10×10 matrix I need something better.
Here I found the following command:
A = sym('A%d', [2 2]);
But it seems to only work in more recent versions of MATLAB while I’m using R2009b.
A not-so-efficient way of doing it would be to write a script to create a string and execute it with
eval.So, the command strings look like this:
Now execute the command strings: