Home »
Public Forums »
archive »
transforming an array where some values can't
transforming an array where some values can't [message #10909] |
Thu, 05 February 1998 00:00 |
bowler
Messages: 7 Registered: February 1998
|
Junior Member |
|
|
I'm trying to write a function that will transform an arbitrary array by taking
hte natural log of every element in the array.
What I have is
function xform, input
temp = alog(input) ; I realize I could combine these 2 statements
return, temp ; but it makes debugging easier
end
Unfortunately, I can't guarentee that there won't be some elements that are
zero and thus invalid arguments to alog. what's the "most efficient" way to
take the alog of any element that's greater than 0 and set the value of ony
that are less than or equal to 0 to some small value (1e-7 for example)?
TIA,
Bruce
|
|
|
Current Time: Sat Oct 11 10:34:19 PDT 2025
Total time taken to generate the page: 0.72489 seconds