MATLAB: How can i use a cell array in the symbolic variables

cell arraysymbolic variables

How can i use a cell array in the symbolic variables?
I have some variables in a matrix (for example [B]).
I want to put the [B] in a cell array.
Is it possible?

Best Answer

Wanted = num2cell(symvar(B))
edit: After your comment.
>> syms a b c d x y z
>> A = [ a*(x^2) , b*(y^3) ; d*(x^2)*y , c ]
A =
[ a*x^2, b*y^3]
[ d*x^2*y, c]
>> B = repelem({A},3,1)
B =
3×1 cell array
{2×2 sym}
{2×2 sym}
{2×2 sym}
>>