Finding maximum in a matrix
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Rohan Mehta
le 22 Juin 2019
Commenté : KALYAN ACHARJYA
le 24 Juin 2019
Suppose I have 1000x1 matrix and my data is from (50,60) and then from (160,170) and so on (i.e randomly distributed), What I want is to find maximum out of this 50 to 60 location and then maximum from 160 to 170 location and so on. How to find this ?
3 commentaires
Réponse acceptée
KALYAN ACHARJYA
le 22 Juin 2019
Modifié(e) : KALYAN ACHARJYA
le 22 Juin 2019
Suppose mat is 1000x1 matrix
%this will give the maximum value within the matrix uptp 50 rows and 60 colm
mat1=mat(1:50,1:60);
max1=max(mat1(:));
You can do the same form other also
mat2=mat(1:160,1:170);
max2=max(mat2(:));
Is this you are looking for?
4 commentaires
KALYAN ACHARJYA
le 24 Juin 2019
how to assign the location's of these maximum to another matrix?
The second part of comment is not clear for me.
Are you looking for this one?
mat_other(r1,c1)
%..........^ index values from first matrix having maximum value
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Matrix Indexing dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!