Filter löschen
Filter löschen

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

109 Ansichten (letzte 30 Tage)
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.

Akzeptierte Antwort

Voss
Voss am 15 Jun. 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}

Weitere Antworten (0)

Produkte


Version

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by