Deleting Cells in Matrix

조회 수: 1 (최근 30일)
sam van Bohemen
sam van Bohemen 2020년 2월 20일
댓글: Walter Roberson 2020년 2월 20일
I have a Matrix 32x5
Looking at every row one at a time.
Am I able to delete all cells that are 3 greater or 3 less than the other cells in that row and then add a zero to the bottom of the column of the deleted cell to keep the matrix complete?
Thanks
  댓글 수: 3
sam van Bohemen
sam van Bohemen 2020년 2월 20일
Hi Walter,
Yes i mean column entries
Thanks
Walter Roberson
Walter Roberson 2020년 2월 20일
num2cell with 1 as the second parameter. That will give you a cell array of column vectors you can process individually. Loop might be easiest. For each delete as appropriate, then pad out to the common length, store back. cell2mat to get back to the array form.

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

답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by