Sign in

username:

password:



Not a member?

Search matlab



Search tips

Subscribe to matlab



matlab by Keywords

Atanh | Autocorrelation | Bandpass Filter | C++ | Conv | Database | Deconv | Excel | FFT | Filter | Filtering | FIR | Fourier Transfrom | FSK | Gaussian Noise | Haykin | IFFT | Image | Java | LFSR | LMS | LPC | MEX | OFDM | QPSK | Radix | Random | Sampling | Segmentation | Simulink | Visual Basic | Waveform | Wavelet

Ads

Discussion Groups

Discussion Groups | Matlab DSP | problem in finding max entry in a matrix

Technical discussion about Matlab and issues related to Digital Signal Processing.

  

Post a new Thread

problem in finding max entry in a matrix - T.Ja...@surrey.ac.uk - Mar 27 12:47:22 2008



Hi ,
  
     i am running  a program in which at one stage i have to check the maximum entry row by row
and also column to column, as far as i know the commands like max(matrix) return row
vector/column vector having the max number or max(max(matrix)) returns a single max entry in
the total matrix , but it does not required to me , i need to find the max no in 1st row then
in 1st column and continue like this , any one can help me in this?

thanks and regards,
Jan



(You need to be a member of matlab -- send a blank email to matlab-subscribe@yahoogroups.com )

Re: problem in finding max entry in a matrix - niks...@gmail.com - Mar 28 6:35:08 2008

Jan,
    Assume A to be the matrix you are interested in computing the max values first by row and
then by column. 
Then, max(A) gives you max values by colums and max(A') (A' - A transpose) gives max values by
rows. You can use a for loop and place them however you want.

Does that solve the problem?

Regards,
Nik.
>Hi ,
>  
>     i am running  a program in which at one stage i have to check the maximum entry row by
row and also column to column, as far as i know the commands like max(matrix) return row
vector/column vector having the max number or max(max(matrix)) returns a single max entry in
the total matrix , but it does not required to me , i need to find the max no in 1st row then
in 1st column and continue like this , any one can help me in this?
>
>thanks and regards,
>Jan



(You need to be a member of matlab -- send a blank email to matlab-subscribe@yahoogroups.com )

Re: problem in finding max entry in a matrix - el01...@mail.ntua.gr - Mar 28 6:36:29 2008

>Hi ,
>  
>     i am running  a program in which at one stage i have to check the maximum entry row by
row and also column to column, as far as i know the commands like max(matrix) return row
vector/column vector having the max number or max(max(matrix)) returns a single max entry in
the total matrix , but it does not required to me , i need to find the max no in 1st row then
in 1st column and continue like this , any one can help me in this?
>
>thanks and regards,
>Jan
***********************
the first entry of max(A) gives you the max entry of the first column of A

the first entry of max(A') gives you the max entry of the first row of A

(from your email i see that you study in UK, can i ask you something relevant?)

Manolis


(You need to be a member of matlab -- send a blank email to matlab-subscribe@yahoogroups.com )

Re:problem in finding max entry in a matrix - Farrukh Aziz - Mar 28 15:50:23 2008

Hey,
  finding the max entry of each row and each column in the matrix
   
  consider a square matrix A=[1 2 4 ; 5 7 2; 4 9 8];
   
  r1=A(1,:) ;
  max(r1);
   
  r2=A(2,:);
  max(r2);
   
  r3=A(3,:);
  max(r3);
   
  c1=A(:,1);
  max(c1);
   
  c2=A(:,2);
  max(c2);
   
  c3=A(:,3);
  max(c3);
   
  in this way u have all the required max values.  Its a crude and simple way to do this.
   
  Hope it solves ur problem
   
  Regards
  Farrukh



(You need to be a member of matlab -- send a blank email to matlab-subscribe@yahoogroups.com )

Re: problem in finding max entry in a matrix - Ahmad El-Saeed - Mar 28 15:50:46 2008

Peace be upon you all,

Try:

a=magic(10);
b=max(a,[],1);   % gets the maximum values in the columns
c=max(a,[],2);       % gets the maximum values in the rows

Regards,
Ahmad El-Saeed

T...@surrey.ac.uk wrote:                                  
  
Hi ,
  
      i am running  a program in which at one stage i have to check the maximum entry row by
row and also column to column, as far as i know the commands like max(matrix) return row
vector/column vector having the max number or max(max(matrix)) returns a single max entry in
the total matrix , but it does not required to me , i need to find the max no in 1st row then
in 1st column and continue like this , any one can help me in this?
 
 thanks and regards,
 Jan



(You need to be a member of matlab -- send a blank email to matlab-subscribe@yahoogroups.com )