How to remove column with 0 in matrix?

2 ビュー (過去 30 日間)
Joshua Chhour
Joshua Chhour 2023 年 6 月 6 日
コメント済み: KSSV 2023 年 6 月 6 日
I have a 0x100x150 double, but how do I get rid of the zero, so it becomes 100x150?
  1 件のコメント
KSSV
KSSV 2023 年 6 月 6 日
Is it 0? Or 1?

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

採用された回答

rakshit gupta
rakshit gupta 2023 年 6 月 6 日
You can use the squeeze() function in MATLAB to remove dimensions with size 1 in a multidimensional array.
The following code will give you, which is a 100x150 array but with same data as A.
You can also refer to Squeeze for more information.
% assuming your 0x100x150 double is named A
B = squeeze(A); % remove dimensions with size 1

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLogical についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by