points = [
-9.9043877608991468201413092380493, 426.34796945271797204125533010993, Maximum
-2.9714737944057521874892206269196, 422.13223302035451265143272598599, Minimum
9.3758615553048990076305298649689, 441.87005169359418197397861057075, Maximum
]
I'd like to do loop through and create a new matrix with just the values where column three matches 'Maximum'.
When trying:
idx = ( points(:,3)=='Maximum' )
I get:
Maximum == Maximum
Minimum == Maximum
Maximum == Maximum
Any ideas? Thanks!
the matrix points as is presented is not a valid matlab matrix unless Maximum is a number. If that is the case then:
idx=find( points(:,3)== Maximum )
will give you the proper indices.
Edit
to obtain a new matrix with the values of "maximum" just
new_matrix=points(idx,1:end-1)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With