Technical discussion about Matlab and issues related to Digital Signal Processing.
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
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
>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
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
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