How to extract specific parts of a matrix
Ältere Kommentare anzeigen
In a 512 x 512 matrix where each cell has a number between 0 and 1000, a large part of the cells in this matrix, for example, contains the value 98 (on the left) and on the other side, a large number of cells contain, for example, the value 900.
In the case of when there is only one matrix, it is easy to determine what numbers the matrix contains on both sides.
But in other matrices these numbers are different
I'm looking for a way to automatically specify these numbers on both sides of a matrix
Thank you for your help
Akzeptierte Antwort
Weitere Antworten (1)
Sulaymon Eshkabilov
am 26 Mär. 2021
0 Stimmen
Logical indexing would be an easy and fast solution.
3 Kommentare
Chad Greene
am 26 Mär. 2021
Can you explain that?
Sulaymon Eshkabilov
am 26 Mär. 2021
A = [1, 2, 3; 5 4 4; 6 4 4]; B = (A==4).*A
By this way, you'll get only values which are equal to 4 and the rest is "0".
Good luck.
lech king
am 27 Mär. 2021
Kategorien
Mehr zu Creating and Concatenating Matrices finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


