필터 지우기
필터 지우기

cell array contain zeros matrix

조회 수: 14 (최근 30일)
Pradya Panyainkaew
Pradya Panyainkaew 2017년 12월 20일
댓글: Michal Dudek 2020년 2월 27일
How to create cell array size 1X100 which contain zeros matrix size 366X28 in each cell

채택된 답변

Harish Ramachandran
Harish Ramachandran 2017년 12월 20일
for i=1:100
a{i} = zeros(366,28);
end
Loop through each cell array block and insert a zeros matrix inside.
  댓글 수: 3
SM
SM 2020년 2월 11일
Is it posible to solve the problem without using loop?
Michal Dudek
Michal Dudek 2020년 2월 27일
Yes, it is possible. Use this code:
a = mat2cell(repmat(zeros(366,28),1,100),366,repmat(28,1,100));

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by