comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Function BYTSCL
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Function BYTSCL [message #24637 is a reply to message #24636] Tue, 10 April 2001 07:18 Go to previous messageGo to previous message
Jaco van Gorkom is currently offline  Jaco van Gorkom
Messages: 97
Registered: November 2000
Member
Steffen Kernchen wrote:
..
>> You are going to have to give us a clue why you
>> should NOT use BYSCL. Is this a religious preference?
>
> *g* no, it is a condition for a given exercise.
> it�s for my first program, i�ve to write for a new lecture at my
> university.
> so the answer for my question should be quite simple. just 3 or 4 lines...

If you would want to use BYTSCL, but you are not allowed to use
the built-in function, then you can just code up your own scaling.
To scale (= multiply) an array by a certain factor (e.g.,
MyFactor=2):
MyArray = MyArray * MyFactor
To substract (or add) any offsets:
MyArray = MyArray - MyOffset
To limit (clip) the array values to a certain range:
MyArray = MyMinRange < MyArray < MyMaxRange
MIN() or MAX() can be used to find the original range of the
array. You could determine the factor and offset you want to use
from them.

It should be possible to code up something sensible in just a few
lines. Beware of possible overflow, if you are in byte type then
things can easily get >255. So I guess it does make for some good
programming exercise...

cheers,
Jaco
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: sec : U Re: Dual head displays
Next Topic: Re: Error on shutdown of widget !@$%

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 16:04:43 PDT 2025

Total time taken to generate the page: 0.00447 seconds