Remove Zeros Matrix on 3D Matrix

2 ビュー (過去 30 日間)
audi rachman
audi rachman 2022 年 1 月 8 日
コメント済み: audi rachman 2022 年 1 月 8 日
I have Matrix A twhich is a 3D matrix that contain zeros matrix, How to delete the zeros matrix?
here i attach the example of my matrix.
the result that i want is matrix A should be (2,3,3)

採用された回答

Matt J
Matt J 2022 年 1 月 8 日
val = val(:,:, any(val,[1,2]) )
  1 件のコメント
audi rachman
audi rachman 2022 年 1 月 8 日
Thank you this one answering my question

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

その他の回答 (1 件)

Torsten
Torsten 2022 年 1 月 8 日
編集済み: Torsten 2022 年 1 月 8 日
function main
val = rand(2,3,4)
val(:,:,3) = []
end

カテゴリ

Help Center および File ExchangeCreating and Concatenating Matrices についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by