How to initialize a1 , a2 ,..............a100 as symbolss in matlab with code

77 Views Asked by At

If we want to use a1 as a symbol in Matlab as follows :

syms $a1$, but I want to use all $a1,a2,.....a100$ as syms ,how can do that with simple code in Matlab ,thanks

1

There are 1 best solutions below

8
On BEST ANSWER

One way is to use A = sym(zeros(100,1)); to create a matrix of 100 symbolic variables.

In new versions of MATLAB,

A = sym('A', [100 1]); or A = sym('A%d%d', [100 1]); can also be used to create a matrix of symbolic variables.