variable value [message #87052] |
Tue, 31 December 2013 09:17  |
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   |
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   |
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   |
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 #87067 is a reply to message #87059] |
Thu, 02 January 2014 00:44  |
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
|
|
|