help-octave
[Top][All Lists]
Advanced

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

assign to infinite a value


From: shivax
Subject: assign to infinite a value
Date: Sun, 28 Oct 2018 13:12:24 -0500 (CDT)

hi 
look that:
max=50;
min=-50;
newArr=[3 4 inf 7 3 2 5 6 inf -inf 9]

i want to assign to inf value max..and to -inf value -1  ==>[3 4 50 7 3 2 5
6 50 -50 9]

i try this:

isInf=find(isinf(newArr))

newArr2(isInf)=max;


but is not correct beacuse isinf(array) give me index of inf and -inf

can you write me other method? thank





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



reply via email to

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