How can you covert a 2-d array into a 1-d array by taking the average of all the values in each row?

Hi
My application is generating a 2-dimensional array of data as it performs multiple sweeps.  I would like to take the mean of all the data in each row and thereby reduce to a 1-dimensional array.  Does anybody have a quick solution.
(Sorry - I am posting many messages at present, I promise to share my acquired knowledge!!!).
Thanks
Ashley. 

Try this.
Attachments:
Mean.JPG ‏5 KB

Similar Messages

  • Finding the average of all the values stored in a two dimentional array

    public int avg(int[][] numbers2){
        int sum = 0;
        float avg = 0;
        for(int r = 0; r < numbers2.length; r++)
          for(int c = 0; c < numbers2[r].length; c++){
              sum += numbers2[r][c];
          }So I have this code that of course finds the sum of all the values stored in the array int[][] numbers. What I am having an issue with is finding the average of the numbers. When I attempt to use:
    avg = sum / numbers2.length; I get the sum / 3 because my array looks like:
    int[][] numbers2 = {{1, 2, 3},
                                {4, 5, 6},
                                {7, 8, 9}
                                          };Any ideas on what I should do or where I could find information on this process?

    2 dimensional arrays have 2 lengths:
    myArray.length and myArray[0].length
    The first one I believe is fixed, the second one may vary from row to row. But if you know that it won't vary, then you can just use the [0] row length.

  • How can you add data from a variable into a column in a data flow?

    I need to populate a table with data from a variable. The data type of the variable is String. I'm running into issues doing it the way I am. I have variable
    User:VariableName = "Some moderately sized string of data"
    When I try to use a Derived Column Transformation Editor to insert the variable into the data flow as a new column, SSIS forces the Data Type to be Unicode String[DT_WSTR] and I can't change it. Additionally the length is 0 and I also can't change that.
    When I run the package it errors with a truncation error. If the length is 0 then that makes sense but then why can't I change it to something that makes more sense?
    What is the correct way to go about this?

    Use advanced editor to change data type and length.
    http://www.sureshjoshi.com/development/ssis-string-variables-in-derived-columns/

  • How can you put your ipod music back into a library ?

    I had to reformat my HD, is there a way to copy the music files on my ipod back into my itunes library ?

    Yes using third party software. First connect the ipod to the PC and wet it to "Enable Disk usage" by rightclicking it in iTUnes, hitting options, then checking the box.
    Now you can use something like yamipod http://www.yamipod.com

  • How do you disable Parental Controls without admin password? When I go on Safari, this window pops ALL THE TIME saying you need to add some certain websites. I really want to get on Facebook and YouTube. I don't even remember the password.

    I need to get on Facebook and YouTube so I can make my videos and post them and post stuff on Facebook to my friends. Please help me? Plus it's an iMac model: A1208. I really need help.

    If I understand correctly, Sonic Kaboom.swf needs to be edited in a separate Flash authoring program and then reinserted into your HTML document. 
    As Murray said, Flash is dead.  Nobody uses it anymore.   We use HTML5, CSS3 and JavaScript animations which have universal support from Smartphones, Tablets and other web devices that can't support Flash.   Look at Edge Animate.
    HTML animation | Download free Adobe Edge Animate CC trial
    Nancy O.

  • HT1789 How can you rename your iPod in iTunes 11?

    How can you rename your iPod in iTunes 11?
    I am using a Mac and an iPod Nano (the old longer one)

    Double-click the name in the device summary screen to get a cursor, and edit the name. In previous versions of iTunes, you could change the name by clicking it once.

  • How can you connect your 4th gen ipod touch to a 3g network?

    how can you connect your 4th gen ipod touch to a 3g network?

    Yu need a device like the following:
    - A MiFi or similar. They are credit-card size devices that act a wifi hotspot and then connect to a cellulare network
    - Use a smart phone that can act as a wifi hotspot to share it s cellular connection. An iPhone will also do that via bluetooth. You need to purchase a tethering plan .

  • The product I bought its not working as i expected, it doesn´t translate the exact information from pdf to excel, how can you help me or how can you return my money back....

    how can you help me

    What about adobé export PDF. ?
    Enviado desde mi iPhone
    El 07/05/2014, a las 23:00, Claudio González <[email protected]> escribió:
    The product I bought its not working as i expected, it doesn´t translate the exact information from pdf to excel, how can you help me or how can you return my money back....
    created by Claudio González in Adobe Reader - View the full discussion
    If you bought Reader, you were swindled, because it's a free program. And it has never been able of converting PDF files to any other format.
    Please note that the Adobe Forums do not accept email attachments. If you want to embed a screen image in your message please visit the thread in the forum to embed the image at https://forums.adobe.com/message/6363992#6363992
    Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page:
    To unsubscribe from this thread, please visit the message page at . In the Actions box on the right, click the Stop Email Notifications link.
    Start a new discussion in Adobe Reader by email or at Adobe Community
    For more information about maintaining your forum email notifications please go to http://forums.adobe.com/thread/416458?tstart=0.

  • How can you restore your backup files from time machine?

    Hi how can you restore your backup files on your mac book pro from time machine? i lost all my pic and files on my phone and then restored it from the last back up which was when i lost all my files i dont know what i did? someone please help!
    Thank You
    Jon

    YOu might get more info if you post in the MAC forum.

  • How can you get a mirror image of a photo on iPhoto?

    How can you get a mirror image of a photo on iPhoto?

    By using an external editor. Preview is already on your Mac. It's called 'Flip Horizontal'
    In order of price here are some other suggestions:
    Seashore (free)
    The Gimp (free)
    Graphic Coverter ($45 approx)
    Acorn ($50 approx)
    Pixelmator ($50 approx)
    Photoshop Elements ($75 approx)
    There are many, many other options. Search on MacUpdate or the App Store.
    You can set Photoshop (or any image editor) as an external editor in iPhoto. (Preferences -> General -> Edit Photo: Choose from the Drop Down Menu.) This way, when you double click a pic to edit in iPhoto it will open automatically in Photoshop or your Image Editor, and when you save it it's sent back to iPhoto automatically. This is the only way that edits made in another application will be displayed in iPhoto.

  • How can you add a 2nd i Tunes account on the same computer?

    How can you add a 2nd i Tunes account to the same computer?

    I had an application where I spawned (= ran with Start Asynchronous Call) multiple (reentrant) copies of VIs, and would occasionally "lose control" of them.  I needed a way to find all VIs that were running "Top Level" and stop them (so I didn't have to log off from Windows).
    I used the Application Property "All VIs in Memory" to get an array of (wait for it ...) All VIs in Memory.  I took each name, opened a VI reference to it (simply wire the name string in, as the VI is, by definition, "in memory"), looked at its VI Execution State, and if it was Run Top Level, Invoked the FP.Close and Abort VI Methods.  [To prevent the VI that did all this from "committing Suicide", I compared the name string with the current Call Chain, and did nothing if there was a match].
    I think you could adopt this idea to do what you need.
    BS

  • How can you watch itunes purchased movies on apple tv. A click on to movies then into purchase thn a click on a movie i want to watch then my apple tv box light starts going on and off plus the screen is blank

    How can you watch itunes purchased movies on apple tv. A click on to movies then into purchase thn a click on a movie i want to watch then my apple tv box light starts going on and off plus the screen is blank

    JasonFromSK wrote:
    With the newest Airport firmware (7.6.1), it seems I should be able to do this.
    Really? I need to check that out!
    You should certainly be able to add content by reference to itunes from such a disk (even before the update) - so long as itunes knows the location of the file (set Preferences not to copy to local library when adding the media) it will stream it to AppleTV if the disk is available.
    I hope you're right, but I'd be surprised if current Extremes can be upgarded to provide a full Home Sharing service - marvellous if they can but I'd be surprised as i've long said we need an Apple media server either based on TC or AE to do this kind of thing.
    AC

  • How can you get OS Lion back if you already downloaded Mavericks?  I CANNOT live with the battery life of 2 hours!!  HELP

    How can you get OS Lion back if you already downloaded Mavericks?  I CANNOT live with the battery life of 2 hours!!  HELP

    Kappy wrote:
    Don't downgrade OS X without first erasing the drive. You cannot restore a Time Machine backup of Lion directly on top of a later version of OS X such as Mountain Lion or Mavericks.
    When you "Restore from a Time Machine Backup.", the drive will be erased for you, but yes, won't hurt to:
    Boot into Recovery (hold ⌘R on boot)
    Utility->Disk Utility->Erase Macintosh HD, then Repair Macintosh HD
    Quit Disk Utility
    Then Select: Restore from a Time Machine Backup.

  • How can you get your photos in the order they are in your computer

    How can you get your photos synced to your phone in the same order as the file on your computer?

    The iPhone Photos app orders photos by date.

  • How can you get your submit buttons to be a single click instead of the default double click?  (The

    How can you get your submit buttons on the quiz template to be a single click instead of the default double click?  (The option to choose double click or not is not showing in properties for this).

    Hmmm... Submit button doesn't need a double click at all. Maybe you are talking about the two-step process? When you click on Submit, the feedback appears with the message to click anywhere or press Y. Is that what you are talking about? If you are talking about a real double-click, something must be wrong in your file. And which version are you using?
    http://blog.lilybiri.com/question-question-slides-in-captivate
    Lilybiri

Maybe you are looking for

  • Not printing nor recognized

    My HP C4385 is not printing anything but the test page.  I am running Windows 7, 64 bit with a wireless network.  The printer worked fine until a few months ago and I'm about ready to throw it out the window.  I can print a test page no problem, wire

  • HP LaserJet M1217nfw MFP used to print wirelessly, now won't

    At some point the printer stopped printing wirelessly.  I completely uninstalled and reinstalled the software from DVD, and have run "wireless" setup several times.  It will only print through a USB cable.  ScanDr only reports that it can't communica

  • Burning data on music cd

    Hi everyone, I'm new to mac... so maybe it's a stupid question... I'm making a music cd for my girlfriend... but she asked only 10 tracks... so I figured, I might aswell fill the cd up with photos and other misc. files... anyone know how to do that?

  • Installing Neospeech in Captivate 5.5

    I continue to get an error saying that I haven't installed Neospeech or Loquendo, even after downloading both from the Adobe site. The osftware appears to be from Macromedia, which is now owned by Adobe. So what is the problem, that it does not show

  • Airplay and airfoil cut out all the time

    Whenever I stream music from my mba via either iTunes or AirFoil to my speakers the sound will cut out all the time.  If I switch the sound output in sound preferences to the airplay speakers then everything works fine and there's no cutting out.  Ho