# Form a matrix from a structure

1 view (last 30 days)

Show older comments

### Accepted Answer

Azzi Abdelmalek
on 4 Feb 2013

Edited: Azzi Abdelmalek
on 4 Feb 2013

Try

x(1,1).data=1;

x(1,2).data=[2 1];

x(2,1).data=rand(2);

x(2,2).data=[1;2];

out=struct2cell(x);

out(:)

### More Answers (2)

Cedric Wannaz
on 4 Feb 2013

If it is a cell array and cells contents have matching sizes:

>> doc cell2mat

### See Also

### Categories

### Community Treasure Hunt

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

Start Hunting!