Azzera filtri
Azzera filtri

combine values from struct.

3 visualizzazioni (ultimi 30 giorni)
FV
FV il 5 Mag 2020
Commentato: Stephen23 il 6 Mag 2020
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?

Risposta accettata

Ameer Hamza
Ameer Hamza il 5 Mag 2020
Modificato: Ameer Hamza il 5 Mag 2020
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

Più risposte (0)

Categorie

Scopri di più su Structures in Help Center e File Exchange

Tag

Prodotti


Release

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by