Extract and Join Matrix

バージョン 1.0.1 (2.3 KB) 作成者: Hernia Baby
Create new matrix with extracting Non-zero submatrix.
ダウンロード: 0
更新 2021/3/20

ライセンスの表示

This code extracts submatrix ~= 0
and creates new matrix combining subs.

dataMat =
0 0 0 0 0 0 0 0 0 0 0 0
0 1 1 1 0 0 0 0 0 0 0 0
0 1 1 1 0 0 0 3 3 3 0 0
0 1 1 1 0 0 0 3 3 3 0 0
0 0 0 0 0 0 0 3 3 3 0 0
0 0 2 2 2 0 0 0 0 0 0 0
0 0 2 2 2 0 0 0 4 4 4 0
0 0 2 2 2 0 0 0 4 4 4 0
0 0 0 0 0 0 0 0 4 4 4 0

|
V

resultMat =
1 1 1 3 3 3
1 1 1 3 3 3
1 1 1 3 3 3
2 2 2 4 4 4
2 2 2 4 4 4
2 2 2 4 4 4

引用

Hernia Baby (2024). Extract and Join Matrix (https://www.mathworks.com/matlabcentral/fileexchange/89017-extract-and-join-matrix), MATLAB Central File Exchange. 取得済み .

MATLAB リリースの互換性
作成: R2021a
すべてのリリースと互換性あり
プラットフォームの互換性
Windows macOS Linux
タグ タグを追加

Community Treasure Hunt

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

Start Hunting!
バージョン 公開済み リリース ノート
1.0.1

fixed code a little bit

1.0.0