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

Home » Public Forums » archive » variable value
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
variable value [message #87052] Tue, 31 December 2013 09:17 Go to next message
Chrisss is currently offline  Chrisss
Messages: 18
Registered: November 2013
Junior Member
Hi guys,
please help me.
When I range a number in gaussian distributions I use: Fo=abs(f+10*(randomn(seed,60))).
But now I would to range Fo value between 0.5 and 1, but not as gaussian distribution. How can I do?
Cheers, Christina
ps. Happy New Year!!!!
Re: variable value [message #87053 is a reply to message #87052] Tue, 31 December 2013 09:24 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Khris writes:

>
> Hi guys,
> please help me.
> When I range a number in gaussian distributions I use: Fo=abs(f+10*(randomn(seed,60))).
> But now I would to range Fo value between 0.5 and 1, but not as gaussian distribution. How can I do?

f0 = cgScaleVector(RandomU(seed, 60), 0.5, 1.0)

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
Re: variable value [message #87054 is a reply to message #87053] Tue, 31 December 2013 09:43 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
David Fanning writes:

>> When I range a number in gaussian distributions I use: Fo=abs(f+10*(randomn(seed,60))).
>> But now I would to range Fo value between 0.5 and 1, but not as gaussian distribution. How can I do?
>
> f0 = cgScaleVector(RandomU(seed, 60), 0.5, 1.0)

Or, maybe this, depending on what you are looking for:

f0 = RandomU(seed, 60)* 0.5 + 0.5

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
Re: variable value [message #87058 is a reply to message #87054] Tue, 31 December 2013 10:44 Go to previous messageGo to next message
Chrisss is currently offline  Chrisss
Messages: 18
Registered: November 2013
Junior Member
Il giorno martedì 31 dicembre 2013 18:43:34 UTC+1, David Fanning ha scritto:
> David Fanning writes:
>
>
>
>>> When I range a number in gaussian distributions I use: Fo=abs(f+10*(randomn(seed,60))).
>
>>> But now I would to range Fo value between 0.5 and 1, but not as gaussian distribution. How can I do?
>
>>
>
>> f0 = cgScaleVector(RandomU(seed, 60), 0.5, 1.0)
>
>
>
> Or, maybe this, depending on what you are looking for:
>
>
>
> f0 = RandomU(seed, 60)* 0.5 + 0.5
>
>
>
> Cheers,
>
>
>
> David
>
> --
>
> David Fanning, Ph.D.
>
> Fanning Software Consulting, Inc.
>
> Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
>
> Sepore ma de ni thue. ("Perhaps thou speakest truth.")

Thank you, Mr Fanning!
I think the last solution is the best for my work. In this way I'm sure that f0 range between the min value 0.5 and the max 1 (not with a gaussian distribution), isn't it?
Cheers,
Christina
Re: variable value [message #87059 is a reply to message #87058] Tue, 31 December 2013 10:51 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Khris writes:

> I think the last solution is the best for my work. In this way I'm sure that f0 range between the min value 0.5 and the max 1 (not with a gaussian distribution), isn't it?

Do you know how to use the Print or Plot command to test it?

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
Re: variable value [message #87067 is a reply to message #87059] Thu, 02 January 2014 00:44 Go to previous message
Chrisss is currently offline  Chrisss
Messages: 18
Registered: November 2013
Junior Member
Il giorno martedì 31 dicembre 2013 19:51:36 UTC+1, David Fanning ha scritto:
> Khris writes:
>
>
>
>> I think the last solution is the best for my work. In this way I'm sure that f0 range between the min value 0.5 and the max 1 (not with a gaussian distribution), isn't it?
>
>
>
> Do you know how to use the Print or Plot command to test it?
>
>
>
> Cheers,
>
>
>
> David
>
> --
>
> David Fanning, Ph.D.
>
> Fanning Software Consulting, Inc.
>
> Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
>
> Sepore ma de ni thue. ("Perhaps thou speakest truth.")

I did it. It works
thank you so much
Cheers,
Christina
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Label orientation
Next Topic: closed contour paths: clockwise or anticlockwise - or actually a mixture?

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

Current Time: Wed Oct 08 15:50:26 PDT 2025

Total time taken to generate the page: 0.11848 seconds