Jump to content

Random number array


Recommended Posts

Hi, guys

I'm trying to generate 10,000 point random number array then calculate some basic statistics.

I wanted to start with only 10 numbers to see if my programming is working first.

I was able to generate random numbers using for loop(N=10).

So random numbers were multiply by scaling factor of 100.

then I have random array in the front panel.

Next step, I tried to calculate max and min so I've used array max&min

but according to number indicator i have connected, values are wrong.

I don't think I'm putting all the numbers in array correctly.

Anybody has suggestions what i'm doing wrong here?

I've just started using labVIEW so I'm really new to this program.

So please understand if I'm asking basic stuff.

I read manuals and bunch of other stuffs but I wasn't able to figure it out.

Thank you guys.

Link to comment

Thank you Dan. That helped a lot.

I had one more question.

When I tried to find sample mean and sample variance it gives me an error.

It says array element conflict. I know my random array is 1-D.

Is there any other way I can calculate sample mean and sample variance?

It doesn't have problem calculating just mean and variance.

Thanks.

Link to comment

thanks dan. you've been great helps so far.

I feel like I learning this program, step by step.

I was trying this case structure having counter.

Basically, counting number of times the random number is greater than the mean.

I thought I got all the logics and circuits correct but im just stuck at case structure here.

and counter just stays at 1.

any thoughts?

Link to comment

Hey SJ,

I'm a little a little concerned at this point and not really sure what your trying to accomplish. It kinda sounds (and looks) like you need help with your homework... Which is fine by me as long as I'm "helping" and not playing proxy.

If I do the work for you, I also do the learning (I never took statistics, so again, this is fine by me :rolleyes: ), but you'll get left out in the end. So before we continue please think through your work using pseudo code and repost. I suspect that by doing so you'll be able to answer most, if not all, of your own questions.

LAVA and I will be around if you really get stuck, however, we can't do the work for you.

~Dan

Link to comment

I understand, Dan. You're right.

My knowledge towards programming is poor.

But I've been trying hard to learn. So I think I almost got this here.

I've been researching online trying to figure this out.

I've looked at some example codes from NI but not much of help though.

Here is what I have so far.

I tried with only 10 numbers to see if it was actually counting correctly,

sometimes it does and sometimes it doesnt.

I looked back my circuit and it seems all make sense.

What do you guys think?

Dan, I got it.I think they were working just fine. When everytime random number is generated, mean changes. I was just comparing the mean at the end of the program to each random numbers.

Thank you for all your help, and I'll keep you advise in mind in the future at LAVA.

QUOTE (Dan DeFriese @ Oct 20 2008, 02:53 PM)

Hey SJ,

I'm a little a little concerned at this point and not really sure what your trying to accomplish. It kinda sounds (and looks) like you need help with your homework... Which is fine by me as long as I'm "helping" and not playing proxy.

If I do the work for you, I also do the learning (I never took statistics, so again, this is fine by me :rolleyes: ), but you'll get left out in the end. So before we continue please think through your work using pseudo code and repost. I suspect that by doing so you'll be able to answer most, if not all, of your own questions.

LAVA and I will be around if you really get stuck, however, we can't do the work for you.

~Dan

Dan, I got it.I think they were working just fine. When everytime random number is generated, mean changes. I was just comparing the mean at the end of the program to each random numbers.

Thank you for all your help, and I'll keep your advise in mind in the future at LAVA.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.