combine values from struct.

I have a struct of 1x30 and every struct have a large double every one different but same number of columns.
I want the values from all the doubles to form one matrix. How can I do that?

 采纳的回答

Ameer Hamza
Ameer Hamza 2020-5-5
编辑:Ameer Hamza 2020-5-5
See vertcat(). Run this example
s1(1).a = [1 2 3];
s1(2).a = [4 5 6; 7 8 9];
s1(3).a = [1 2 3; 4 5 6; 7 8 9];
vertcat(s1.a)
Result
ans =
1 2 3
4 5 6
7 8 9
1 2 3
4 5 6
7 8 9

更多回答(0 个)

类别

帮助中心File Exchange 中查找有关 Structures 的更多信息

产品

版本

R2020a

标签

Community Treasure Hunt

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

Start Hunting!

Translated by