필터 지우기
필터 지우기

How to fill cell arrays with zeros to make them equal

조회 수: 4 (최근 30일)
Joseph Lee
Joseph Lee 2017년 12월 10일
편집: Walter Roberson 2017년 12월 10일
M=
{10x107}
{10x108}
{10x103}
{10x105}
how to fill each cell with zeros to reach the size of the max length cell
Gives
M=
{10x108}
{10x108}
{10x108}
{10x108}

채택된 답변

Matt J
Matt J 2017년 12월 10일
for i=1:numel(M)
M{i}(end,108)=0;
end
  댓글 수: 1
Walter Roberson
Walter Roberson 2017년 12월 10일
편집: Walter Roberson 2017년 12월 10일
That will write 0 at M{2}(10,108) but that should not be changed.
for i=1:numel(M)
if size(M{i},2) < 108
M{i}(end,108)=0;
end
end

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 MATLAB에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by