Extract and Join Matrix

版本 1.0.1 (2.3 KB) 作者: Hernia Baby
Create new matrix with extracting Non-zero submatrix.
0.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