Position of a data at Matrix

조회 수: 3 (최근 30일)
sama
sama 2015년 1월 14일
댓글: Sara 2015년 1월 14일
Hello. I have a matrix 1000*2. Then I found the maximum data in first column. Lets say the maximum is for 500*1. Then I need to get the number in 500*2. How can I find out what is the position of my maximum data please?
Thanks

채택된 답변

Sara
Sara 2015년 1월 14일
Given the matrix A
[i,j] = find(A == max(max(A))
  댓글 수: 2
sama
sama 2015년 1월 14일
Thanks. However, I am using my matrix at a for loop. Before that, I am calling my data from an Excel file. So, I am looking for anything to add to my code. I am using the maximum and I wanna call the position the maximum. Do you think find is still a good idea?
for i=1:n-1; sheeti=xlsread('Book1.xlsx',i); A(i)=[min(sheeti(:,2))]; End
Sara
Sara 2015년 1월 14일
What do you want to store in A:
  • The minimum value of sheeti
  • The position of the minimum value of sheeti

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Operating on Diagonal Matrices에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by