Info

此问题已关闭。 请重新打开它进行编辑或回答。

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

1 次查看(过去 30 天)
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
编辑: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