Effacer les filtres
Effacer les filtres

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 vues (au cours des 30 derniers jours)
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.

Réponse acceptée

Stephen23
Stephen23 le 11 Jan 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

Plus de réponses (0)

Catégories

En savoir plus sur Structures dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by