Converting a cell symbolic matrix into simple symbolic matrix

6 views (last 30 days)
Hello all,
I am having a problem, in which I am having a cell of 3d symbolic object matrix, but I need to convert this matrix into simple symbolic matrix.
I tried using 'cell2mat' function but it is not helping as this function doesn't help when cell contains symbolic objects.
I need to convert into simple matrix as, I need to perform some multiplication operation on simple matrix, which is not possible if it is in cell form.
Can anyone help me, in this regard.
I shall be thankful.
Best regards,
Alok Singh

Answers (1)

Andrei Bobrov
Andrei Bobrov on 29 Oct 2011
about symbolic value 3d
used ideas by Walter Roberson
[x y z] = ndgrid(1:10,1:10,1:10);
k = regexp(sprintf('A%-d_%-d_%-d ',[x(:),y(:),z(:)]'),' ','split');
k = cellfun(@sym,k(1:end-1),'un',0);
A = reshape([k{:}],size(x))
answer on your question
k - array cell with symbolic value
out = reshape([k{:}],size(k))
  1 Comment
Alok
Alok on 29 Oct 2011
Hello andrei,
As I mentioned in my problem, I already have this matrix and I used kind of same thing, but my main problem is to convert cells into matrix having symbolic objects.
thanks

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!