Extract and Join Matrix

Create new matrix with extracting Non-zero submatrix.
0 descargas
Actualizado 20 mar 2021

Ver licencia

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

Citar como

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

Compatibilidad con la versión de MATLAB
Se creó con R2021a
Compatible con cualquier versión
Compatibilidad con las plataformas
Windows macOS Linux

Community Treasure Hunt

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

Start Hunting!
Versión Publicado Notas de la versión
1.0.1

fixed code a little bit

1.0.0