Can the mean be taken from an array of daq reads

I am trying to read in thermocouple readings. First, I used the Sample Channels block, but this was unwanted due to the daq clicking with each reading. Now, I am using a continuous reading, but I need to take the mean in order to reduce the effects of the noise on the readings. When I try to do this, I am denied. Any help is appreciated

Hi ToddT -
What do you mean by denied? Does it not work?
If you are building these continuously read values into an array, the simplest way to take the mean is to use Add Array Elements found on the Numeric Functions Palette. Take this sum and divide it by the number of elements in the array (use the Array Size VI). I've attached a screenshot of how this method would work.
Becky B.
Applications Engineer
National Instruments
Becky Linton
National Instruments
Field Engineer
Office: 734-464-2463
Cell: 248-709-2822
Email: [email protected]
Attachments:
MeanOfAnArray.GIF ‏5 KB

Similar Messages

  • How should I correct my code to find the mean, median & mode from an array?

    Hello everyone,
    I have been learning Java for about a month now and am stuck with the following code. There are no highlighted errors on my program when typing it into Eclipse but I get an error message when I try to run my program.
    Here is the code:
    import java.util.Random;
    * <dl>
    * <dt>Purpose:
    * <dd>Example program that randomly generates, collates and outputs numbers.
    * <dt>Description:
    * <dd>This program generates 10000 random numbers between 0 and 99 inclusive.
    * It also keeps count of how many times each number is generated and prints these
    * counts out to the screen in the format of mean, median and mode.
    * </dl> 
    * @author  Woodie Woodpeck
    * @version $Date: 2008/10/27 14:44:00 $
    public class Exercise3Point08
         public static void main(String[] args)
                   int[] counts=new int [100];
                   for(int i=0;i<100;i++)
                        counts=0;
                   Random r=new Random();
                   for(int n=0;n<10000;n++)
                        counts[r.nextInt()%100]++;
                   double sum=0.0;
                   int maxCnt=0;
                   int mode = 0;
                   int runningCount=0;
                   int median = 0;
                   for (int i=0;i<100;i++)
                        sum+=(i*counts[i]);
                        if (counts[i]>maxCnt)
                             mode=i;
                             maxCnt=counts[i];
                        if (runningCount<5000&&(runningCount+counts[i])>=5000)
                             median=i;
                        runningCount+=counts[i];
                   System.out.println("Mean =" + (sum/10000));
                   System.out.println("Median =" + median);
                   System.out.println("Mode =" + mode);
    Here is my error message:Exception in thread "main" java.lang.UnsupportedClassVersionError: Bad version number in .class file
         at java.lang.ClassLoader.defineClass1(Native Method)
         at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
         at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
         at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
         at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
         at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
         at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
         at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
    And that's it. Hmmmm. Strange. I hope someone can help.
    Many Thanks
    Wood                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    Hi Edward,
    I moved the file from my college computer to my home computer using a USB stick and changed the workspace path on my Eclipse software to match the files that I transferred. I also cleared out a lot of random code that I had lying around my hard-drive before trying to use the code that I pasted above.
    From reading the output I guess there is a problem with the class. Do you think I might have transferred the file from one computer to another incorrectly? Do you know how I can clean and rebuild a project? Eclipse seems quite daunting and awfully complicated for a beginner!
    Thanks
    Wood

  • Bought programs from iPad, but  didnt download tem, said temporarly offliner, but The Money elas taken from my account, Bought programs from iPad, but  didnt download tem, said temporarly offliner, but The Money elas taken from my account

    HI,
    i bought some programs from my iPad, but it didnt download, and The Money was taken from my account.

    Which means you can now download them to any of your iOS devices that use that AppleID.

  • Can the recording you make from the Dictaphone App be transcribed directly to your ipad?

    can the recording you make from the Dictaphone App be transcribed directly to your ipad?

    No it appears to simply be an audio recorder from the description in the App store.
    You could try out Dragon Dictation as it scribes as you record.

  • On the iMac G4 can the processor be changed from 1000mhz to a 1024mhz?

    On the iMac G4 can the processor be changed from 1000mhz to a 1024mhz?

    It's an old iMac that my parents have and want to install a high seep (speed) Internet modem and it's requiring a 1024mhz
    Ignore the requirement. 1000 is close enough to 1024 not to make a difference.  They cannot be checking the speed anyway.
    You may find youtub videos slow.
    What version of mac os?
    Here is how to find out what version of Mac OS you are running:
    Click on the blue apple in the upper left hand of the screen.
    click on this icon
    Click on the first line, "About This Mac"
    Most of these are numbers & that's what we want.
    What version & Processor do you have?
    You need 10.4 to get a relatively current web browser.
    Opera
    http://www.opera.com/browser/download/requirements/
    http://www.opera.com/download/
    OmniWeb 5.11, which, I believe is built on the same framework as Safari 5,
    Safari 4.1.3 for Tiger
    http://support.apple.com/kb/DL1069
    iCab - The Taxi for the Internet
    http://www.icab.de/
    for PPC
    tenfourfox
    "World's most advanced web browser. Finely tuned for the Power PC."
    http://www.floodgap.com/software/tenfourfox/
    alternative download site:
    http://www.macupdate.com/app/mac/37761/tenfourfox
    What is my user agent?
    http://whatsmyuseragent.com/
    A  larger list:
    http://www.macmaps.com/browser.html

  • I cant remove the pictures ive taken from my phone to my computer

    im using a iphone 4 on ios 5.0.1. and i cant remove the pictures ive taken from my phone to my computer on my mac or pc. it wont let me access them. i here theres a way on mac to auto sync the them with icloud and photo stream. and to make it clear i want to move photos from the iphone to the computer

    iOS: Importing personal photos and videos from iOS devices to your computer

  • I use a macbook pro. Several months ago I signed up for the Photoshop/lightroom offer and the payments are taken from my bank but I am unable to locate the product. I just get a message saying that my trial is expired. I am really desperate.

    I use a macbook pro. Several months ago I signed up for the Photoshop/lightroom offer and the payments are taken from my bank but I am unable to locate the product. I just get a message saying that my trial is expired. I am really desperate.

    Sign in, activation, or connection errors | CS5.5 and later
    Mylenium

  • HT1689 i purchased the remaining album of Luke Bryan and the funds were taken from my itunes card, but I didn't receive the music

    I purchased the remaining album to Luke Bryan and the funds were taken from my itunes card, but I did not receive the music?

    The songs are not still downloading in the Downloads tab in the iTunes store app, or do they show in the Purchased tab in the app for downloading ? Or does the Store > Check For Available Downloads menu option on your computer's iTunes find it ?

  • Why did the videos get taken from festival?

    Why did the videos get taken from festival?

    Ten days and still no reply. Thanks, Apple. It's companies like you and EA that make me think you guys are only in it for the money. I payed $2.99 for this dn app and no refund. But it doesn't matter anymore because I jailbroke my iPod and got the app back. Looks like you lost a customer.

  • If I need to buy more iCloud storage, will the money be taken from the cc I have on file or can it come from money I have in my iTunes account?

    I need more iCloud coverage. I want the money to come from the balance I have in my iTunes account and not from the cc I have on file. Is that possible?

    I should have said exactly as in your post body as opposed to the heading! They are opposites!

  • Can the JPEG be separated from the DNG?

    In PSE11 I saved a DNG and embeded a full size JPEG. Is there anyway to separate the JPEG? I really don't want to have to create another JPEG.

    gegjr wrote:
    Mr. Cole,
    Call me "Rob", please. Mr. Cole is my father , it's also what my grade school teachers used to call me when I was bad .
    I am intimately familiar with Lightroom, although even today I learned something new about it.
    Lightroom can embed or update the jpeg preview in a DNG, but can't (or won't, depending on how you look at it) read/display/import them...
    It *thinks* of the embedded jpegs as being for "outsiders" - not necessary in Lightroom, since it's primarily a raw editor - it writes them, so why would it need to read them? i.e. the embedded jpeg should look exactly like the raw does in Lightroom after editing, which granted may be different than immediately after import.
    FWIW, you are among many who would like the capability to display embedded previews, perhaps add your vote here:
    http://feedback.photoshop.com/photoshop_family/topics/lightroom_capability_to_display_embe dded_preview
    I voted for it too - I'm just trying to explain what is probably the rationale for the current handling.
    In the mean time, there is a solution:
    RawPlusJpeg - will extract the jpeg previews from the DNGs and import them into Lightroom.
    (I'm not sure if the icc-profile is always correct, but so far, they've been looking right - please let me know if you have any color issues).
    Cheers,
    Rob

  • How can i use class reference from an array effeciently?

    Hi,
    I made some test here with getting a class reference from an array and using the reference's methods or variables.
    Basically arrayEx is a container of type Array and it contains the Person's class instance in it. Num is a number extracted from the Person's instance
    Example #1----Strongly typed
    Var reference:Person;
    Var num:int;
    //Assignation
    reference=arrayEx[0];-----IT IS SLOW HERE
    //Use
    num=reference.number --- IT IS FAST HERE
    Example #2---Not typed
    Var reference:*;
    Var num:int;
    //Assignation
    reference=arrayEx[0]; ---- IT IS FAST HERE
    //Use
    num=reference.number ---IT IS SLOW HERE
    No matter what i change in both code like casting Person on arrayEx, i cant seem to make them work both fast at the same time
    If someone knows how, please tell me,
    Dominik

    Hi,
    I made some test here with getting a class reference from an array and using the reference's methods or variables.
    Basically arrayEx is a container of type Array and it contains the Person's class instance in it. Num is a number extracted from the Person's instance
    Example #1----Strongly typed
    Var reference:Person;
    Var num:int;
    //Assignation
    reference=arrayEx[0];-----IT IS SLOW HERE
    //Use
    num=reference.number --- IT IS FAST HERE
    Example #2---Not typed
    Var reference:*;
    Var num:int;
    //Assignation
    reference=arrayEx[0]; ---- IT IS FAST HERE
    //Use
    num=reference.number ---IT IS SLOW HERE
    No matter what i change in both code like casting Person on arrayEx, i cant seem to make them work both fast at the same time
    If someone knows how, please tell me,
    Dominik

  • Can the iPad download software from the web like the Palm TX can??

    Can the iPad download software/applications from the web that you can then upload to your Desktop or Laptop like the Palm TX can? (yes I've got one just for that reason but I'd love to have an Apple branded product)
    So far the Apple Store people don't seem to know.
    If not, there will be many people won't buy it, me included... And every person that does't buy one is a loss of revenue.
    The lack of this key ability is why I haven't bought an iPod or iPhone…
    Come on Apple answer our prayers.

    YES, exactly.... I do NEED a small light weight device (smaller and cheaper than a Mac laptop) to carry around with me every day to download software to that I can download to use on my home computer.
    The Palm TX was such a device that served such purpose... Somewhat over priced for for its small storage capacity and no longer available but a good product idea.
    Except for the once a month NEED to download large applications (mostly version updates), I don't really have a NEED for cable broadband @ $49.99 per month ($599.88 per year) or DSL @ $39.99 per month (479.88) per year.
    My email, shopping, banking and such only NEEDS dial-up @ $99.00 a year, which is what I have.
    The fact people feed their WANTS instead of choosing only to feed their NEEDS is why many people are in debt often over their heads.
    I haven't had any built up debt for decades. I try very hard to only take care of my NEEDS and not squander money on things I only WANT but don't really NEED.
    I LOVE the Mac OS, it's one of the best OSs out there (priced good too)..... Next to Xerox's "Small Talk" (in-house R&D only) and Unix. But Apple's pricing of computers may drive me to the Dark Side or the Gray Side.. Linux .
    And I'm also hoping that USB 3 will be soon on Macs so I don't have to pay the extra freight for Firewire as USB 3 will serve my NEED for faster than USB 2 speeds to the external devices I NEED to use.
    One of the Prime Rules of Business is... Volume = Profit (or more profit)

  • As I was installing the Windows 7 on my Imac and stated how I wanted to divide the drive I put 160, but I want to add more space how can I can the drive space to from 160 to 250? please help thank you.

    As I was installing the Windows 7 on my Imacwith the bootcamp  and stated how I wanted to divide the drive I put 160,  but I want to add more space because of the adobe software it will not install two of them, so how can I add more on the drive space to from 160 to 250? please help thank you.

    I'm not sure this is what you're looking for, but it might help:
    "If you made the Windows partition too small
    First, back up all the information on your Windows partition. Then run Boot Camp
    Assistant to restore your disk to a single volume. Restart your computer and use Boot
    Camp Assistant to partition the disk again and reinstall Windows. Don’t forget to install
    the Boot Camp drivers after installing Windows."
    (from Bootcamp Assistant Manual see pg 22)

  • CAN THE IPHONE BE RESTORED FROM ANOTHER COMPUTER?

    I plugged in my iPhone to my Windows 7 computer through the USB port.
    iTunes ran and I proceeded to update the OS. This failed. Not Apples fault.
    Rather, it's Microsoft's fault because there's a bug in their last Windows update where it disables USB ports.
    The bug is: if I plug a device to a USB port, it's not recognized at all (nothing happens).
    If the device was already plugged in when I turned on the computer, the USB port works.
    However, if I then unplug that device and plug it back in, it doesn't work.
    The USB where my iPhone was plugged in stopped working because I think the iTunes update turns the USB
    port on and off.
    Since the OS did not get installed, iTunes told me I must restore my iPhone to the factory settings.
    That did not work because of the USB port problem. I could not even turn on my iPhone. It was totally non-functional.
    I then went to my sons computer and did a restore, but because all of my data is on my computer,
    I lost EVERYTHING. Or is it lost? I copied the music\itunes folder from my bad computer to my sons computer,
    but when restore ran, it did not recognize this data, instead it recognized my sons iPod data.
    My Question is: Is there a way to copy the iPhone data on my stricken computer and transfer that to my sons
    computer where I can then do a restore using that data?
    Can I just manually copy a folder from the broken computer to the good computer?
    Thanks.

    Actually, never mind. I was able to get the procedure for using the terminal to format partitions of a specific size, and found out that the EFI partition is automatically generated when partitioning the drive, so I only had to create a 400 MB Recovery partition (although I couldn't get it smaller than 528 MB), a 900 MB OSBoot partition, and the rest as Media. Using Disk Utility, I recovered the downloaded disk image to the OSBoot partition, reconnected the hard drive, plugged in the AppleTV and let her rip.
    Flashing question mark gone, although for some reason it initially booted in recovery mode, where I was supposed to be able to restart, run diagnostics, or restore firmware to factory resets. Diagnostics ran fine, but I was not able to restore to factory resets. Nevertheless, when I restarted again, the AppleTV worked fine. I even downloaded a couple of updates, viewed some trailers, etc.
    This was fun! Thanks for your help!

Maybe you are looking for