Extract and Join Matrix

Version 1.0.1 (2,3 KB) von Hernia Baby
Create new matrix with extracting Non-zero submatrix.
0 Downloads
Aktualisiert 20. Mär 2021

Lizenz anzeigen

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

Zitieren als

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

Kompatibilität der MATLAB-Version
Erstellt mit R2021a
Kompatibel mit allen Versionen
Plattform-Kompatibilität
Windows macOS Linux

Community Treasure Hunt

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

Start Hunting!
Version Veröffentlicht Versionshinweise
1.0.1

fixed code a little bit

1.0.0