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

109 次查看(过去 30 天)
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.

采纳的回答

Voss
Voss 2022-6-15
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}

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Logical 的更多信息

产品


版本

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by