Azzera filtri
Azzera filtri

I have 3 double array of sizes 6x1 double, 4x1 double and 5x1 double. I like to combine them to make a structure of size 1x3 struct containing all these 3 double arrays.

6 visualizzazioni (ultimi 30 giorni)
I have 3 double array of sizes 6x1 double, 4x1 double and 5x1 double. I like to combine them to make a structure of size 1x3 struct containing all these 3 double arrays.
If we click on 1x3 struct, inside it should look like this:
Fields times
1 6x1 double
2 4x1 double
3 5x1 double
How can I do it? Could you kindly help? Thank you.

Risposta accettata

Stephen23
Stephen23 il 11 Gen 2023
A = rand(6,1);
B = rand(4,1);
C = rand(5,1);
S = struct('times',{A,B,C})
S = 1×3 struct array with fields:
times

Più risposte (0)

Categorie

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

Community Treasure Hunt

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

Start Hunting!

Translated by