Comparing Matrices of Differing Dimensions, and Creating a New Matrix which meets a criteria
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Chris Stout
am 25 Jul. 2020
Kommentiert: Chris Stout
am 25 Jul. 2020
I have two row vectors: A = [1 2 2 3 4 5 6], B = [2 1 45 6]
I want all the elements of B that are bigger than A to be eliminated and a new matrix with the remaining elements to be saved.
This is what I have so far:
A(A<=B) = []
But this only works if the matrix dimensions are the same, is there any way to do this comparison and return a matrix which satisfy the condition?
Thanks, Chris
Akzeptierte Antwort
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Matrix Indexing finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!