I want to create cell arrays containing all zero elements in them.

150 vues (au cours des 30 derniers jours)
Teshome Kumsa
Teshome Kumsa le 15 Juin 2022
Commenté : Voss le 15 Juin 2022
Dear all,
I am dealing with some stress transformation. I want to create a cell array C = cell (1,20). In each cell array, I want to fill C{1,1}=zeros (2600,6), C{1,2}=zeros (2600,6), and son. I can do this in a traditional way one by one, but I am here to see a simpler way. I want this because I will use a cell array of all zero elements in a loop.

Réponse acceptée

Voss
Voss le 15 Juin 2022
C = repmat({zeros(2600,6)},1,20)
C = 1×20 cell array
{2600×6 double} {2600×6 double} {2600×6 double} {2600×6 double} {2600×6 double} {2600×6 double} {2600×6 double} {2600×6 double} {2600×6 double} {2600×6 double} {2600×6 double} {2600×6 double} {2600×6 double} {2600×6 double} {2600×6 double} {2600×6 double} {2600×6 double} {2600×6 double} {2600×6 double} {2600×6 double}
  2 commentaires
Teshome Kumsa
Teshome Kumsa le 15 Juin 2022
Thank you! I always get answers on this platform.
Voss
Voss le 15 Juin 2022
You're welcome!

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Matrices and Arrays dans Help Center et File Exchange

Produits


Version

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by