help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: change element min in matrix


From: gigiolone123
Subject: Re: change element min in matrix
Date: Fri, 15 Nov 2019 05:01:49 -0600 (CST)

excuse me...i rewrite correct code..


I'm re-evaluating the strategy .. it is correct but there is a problem in 
case of equal minimums 

Example: 
g=
  35    1    1   26   19   24 
    3   32    1   21   23   25 
   31    1    2   22   27   20 
    8   28   33   17   10   15 
   30    5   34   12   14   16 
    4   36   29   13   18   11 

m=min(g')'
g(g==repmat(m,1,columns(g)))=0 


 35    0    0   26   19   24     ====> is not correct ( i want to change in
0 only the first value 
    3   32    0   21   23   25 
   31    0    2   22   27   20 
    0   28   33   17   10   15 
   30    0   34   12   14   16 
    0   36   29   13   18   11 

Correct is: 


 35    0    1   26   19   24     ====> is correct ( i change only first
minimum value)
    3   32    0   21   23   25 
   31    0    2   22   27   20 
    0   28   33   17   10   15 
   30    0   34   12   14   16 
    0   36   29   13   18   11 


I apologize if I did not specify before that I only want the first minimum
reset



--
Sent from: https://octave.1599824.n4.nabble.com/Octave-General-f1599825.html



reply via email to

[Prev in Thread] Current Thread [Next in Thread]