Create a cell array containing the first 3 doubles from another cell array
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Fabio Taccaliti
le 5 Juil 2022
Commenté : Fabio Taccaliti
le 5 Juil 2022
Hello,
I have a cell araay CCC (500x1 cell), containing 500x1 doubles.
I would like to create a new cell array (a) with just the first three doubles (500x1 each) from CCC.
I tried with a = {CCC{1}:CCC{3}}; but is not working, how can I do it?
Thanks in advance for the help :)
0 commentaires
Réponse acceptée
Garmit Pant
le 5 Juil 2022
Modifié(e) : Garmit Pant
le 5 Juil 2022
Hello Fabio
It is my understanding that you want to extract the first three cells from a cell array CCC.
This can be achieved using the following code snippet:
a = CCC(1:3);
You can consult the following example to see the effects of the command listed above.
c3 = {[1 ; 2 ; 3 ; 4] [1 ; 2 ; 3 ; 4] [1 ; 2 ; 3 ; 4] [1 ; 2; 3; 4; 5]}
c4 = c3(1:3)
Plus de réponses (1)
Voir également
Catégories
En savoir plus sur Multidimensional Arrays dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!