The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
 All Forums
 Origin Forum for Programming
 Forum for Origin C
 random numbers

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
pegor Posted - 02/27/2005 : 09:50:44 AM
Origin Version (Select Help-->About Origin): 7.5 SR4
Operating System: win xp

Hi,

i want to generate some random numbers that have poisson distribution.
i found this labtalk command:
Poisson(npts, mean, seed)

Does anybody know how can i use this command to generate a random number?

I tried this:

void test()
{
col(1)=Poisson(10, 0, 2);
}

but this is not working.

Thanks in advance
2   L A T E S T    R E P L I E S    (Newest First)
verrallr@a Posted - 03/01/2005 : 10:18:52 AM
Maybe you got the parameters wrong?

For me, this works:

col(1)=poisson(10,3);

or col(1)=poisson(10,3,2);

Just using what you used, col(1)=poisson(10,0,2); just gave me zeros in col(1).

Richard.
cpyang Posted - 02/27/2005 : 12:22:14 PM
Here is how you can use the LabTalk function Poisson,

 

void tt(int nCol = 1)
{
LT_execute("temp=Poisson(1000, 3)");// create 1000 points with mean = 3, result in dataset called temp
Worksheet wks = Project.ActiveLayer();
Dataset dtemp("temp");// dataset temp can be accessed in OC like this
Dataset aa(wks,nCol-1);// col(1), col(2) etc as Dataset
aa = dtemp;
LT_execute("del temp");// best to clean up temp dataset
}





Or you can also call the nag_poisson_dist function, which is more involved.

CP



The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000