How can i use a cell array in the symbolic 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?

3 件のコメント

madhan ravi
madhan ravi 2019 年 8 月 22 日
You want to put symbolic variables in a cell array or convert the matrix to a cell array?? Illustration if plausible.
masoud jiryaei
masoud jiryaei 2019 年 8 月 22 日
I actually want to put symbolic variables in a cell array.
masoud jiryaei
masoud jiryaei 2019 年 8 月 22 日
編集済み: masoud jiryaei 2019 年 8 月 22 日
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] }

サインインしてコメントする。

 採用された回答

madhan ravi
madhan ravi 2019 年 8 月 22 日
編集済み: madhan ravi 2019 年 8 月 22 日

1 投票

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}
>>

2 件のコメント

masoud jiryaei
masoud jiryaei 2019 年 8 月 22 日
Are you sure?
there is not anything in B !
madhan ravi
madhan ravi 2019 年 8 月 22 日
celldisp(B)

サインインしてコメントする。

その他の回答 (1 件)

カテゴリ

ヘルプ センター および File ExchangeStructures についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by