remove the empty zero value layers in multidimensional matrix

Let's say. I have nD array of any size and dimensions.
How can I get delete zeros layers?
Thanks

3 件のコメント

James Tursa
James Tursa 2019 年 2 月 13 日
Please provide a short example of input and desired output. Are you trying to delete 2D pages that consist of entirely 0's, or what? The example will clarify.
sveta sveta
sveta sveta 2019 年 2 月 13 日
Yes, I'm trying to delete 2D layers that consist of entirely 0's.
For example, I have (n1,n2,n3) array. After deleting I get (n1-k1,n2-k2,n3-k3) array.
Where k1, k2, k3 are the number of layers to delete.
James Tursa
James Tursa 2019 年 2 月 14 日
編集済み: James Tursa 2019 年 2 月 14 日
You didn't provide an example. From your description, the 2D layer could be along any dimension?

サインインしてコメントする。

回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeResizing and Reshaping Matrices についてさらに検索

質問済み:

2019 年 2 月 13 日

編集済み:

2019 年 2 月 14 日

Community Treasure Hunt

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

Start Hunting!

Translated by