Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

I'm trying to set certain rows in a 3 dimensional matrix 0

조회 수: 1 (최근 30일)
Anush Lingamoorthy
Anush Lingamoorthy 2017년 9월 19일
마감: MATLAB Answer Bot 2021년 8월 20일
I have created a 3-Dimensional matrix (remove_bad_data) of size
11*600*14 (rows*coloumns*sheets)
I wish to remove certain rows on each sheet. Eg.
remove_bad_data(10,:,2)=[];
remove_bad_data(3,:,3)=[];
But I get the following error:
A null assignment can have only one non-colon index.
How do I fix this issue?
  댓글 수: 1
José-Luis
José-Luis 2017년 9월 19일
You can't set them to empty, that'd mess up the dimensions of your array.

답변 (1개)

José-Luis
José-Luis 2017년 9월 19일
편집: José-Luis 2017년 9월 19일
Since it is impossible setting them to empty without actually changing your array, you could use NaN instead.
data(10,:,2) = NaN;
For example. Or actually use 0 like the header of your question suggests instead of trying to set them to empty.

Community Treasure Hunt

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

Start Hunting!

Translated by