How can i use a cell array in the symbolic variables?

2 visualizaciones (últimos 30 días)
masoud jiryaei
masoud jiryaei el 22 de Ag. de 2019
Respondida: masoud jiryaei el 22 de Ag. de 2019
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?
  3 comentarios
masoud jiryaei
masoud jiryaei el 22 de Ag. de 2019
I actually want to put symbolic variables in a cell array.
masoud jiryaei
masoud jiryaei el 22 de Ag. de 2019
Editada: masoud jiryaei el 22 de Ag. de 2019
for example : I have this 2-by-2 matrix : [A] = [ a*(x^2) , b(y^3) ; d*(x^2)*y , c ].
and I want to put it in a cell array 3-by-1 : {b} = { [A] ; [A] ; [A] }

Iniciar sesión para comentar.

Respuesta aceptada

madhan ravi
madhan ravi el 22 de Ag. de 2019
Editada: madhan ravi el 22 de Ag. de 2019
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}
>>

Más respuestas (1)

masoud jiryaei
masoud jiryaei el 22 de Ag. de 2019
Thanks

Categorías

Más información sobre Symbolic Variables, Expressions, Functions, and Preferences en Help Center y File Exchange.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by