How can I create sub-arrays based on the positions of indicies in a separate index array?

Please forgive me if this question is basic or obvious. I am fairly new to LabVIEW and I'm trying to learn as I go along.
I have a 1D array of index values (the number of possible index values is not fixed, but can vary between uses of the application; it could be just {0, 1} on one day and {1, 5, 11, 678} on another) and a 1D array of measurement values (doubles). I'd like to parse the measurement values into sub-arrays for each index, so that if my index array was:
[0 1 1 1 1 5 5 0 5 5 1 0 1 1 5]
and my measurement array was:
[0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 0.10 0.11 0.12 0.13 0.14 0.15]
I would get back 3 sub-arrays:
[0.1 0.8 0.12]
[0.2 0.3 0.4 0.5 0.11 0.13 0.14]
[0.6 0.7 0.9 0.10 0.15]
I know there must be a simple way to do this, I guess I'm just stuck too much in matlab-array thinking to figure it out... please help!
-- jph
Solved!
Go to Solution.

jamespherman wrote:
Thus, I figured it might be possible to generalize this idea and send multiple sets of XY values to an XY graph.
OK, all we need is a trivial modification of what we already have. XY graph data is easiest handled using complex data. Here's a quick rewrite. See if this works for you.
LabVIEW Champion . Do more with less code and in less time .
Attachments:
SplitInGroupsGraph.vi ‏14 KB

Similar Messages

  • Create sub-arrays based on the positions of indicies in a separate index array?

     I have a 1D array of index values and a 1D array of measured values. As an example:
    Index array: 1, 2, 4, 7, 126, 127,129, 214, 215
    Measurement array: 5, 6, 8, 4, 4, 9, 8, 7, 5 
    I want to get sub-arrays of measurement array (three for this example):
    [5,6,8,4], [4,9,8],[7,5]
    A sub-array is generated when there is a big gap (this value is known) between consecutive elements of Index array (126-7, 214-129, this value is known, say 80).
    How to do this in labview.
    Thanks
    Solved!
    Go to Solution.

    Alice12 wrote:
    I tried to generate your program but there is some problem (I dont know the false case).
    And I want to find the maxima of each sub-array and then find their average (this should be the final output).
    You have it mostly right.  I explained in my post what's in the false case: an increment (+1) for the top shift register.  The other wires pass straight through.  The image I posted is a "snippet" - it's actual code.  You can drag it into a block diagram (with some web browsers, you will need to drag to your desktop first, and from there to the block diagram).  There is a bug in the snippet creation where it does not always show cluster contents properly, and that's what happened here.  The array constant wired to the left side of the lower shift register contains a cluster containing an array of numeric values.  You will see this if you load the snippet.  I hope that you were able to understand the logic of this code as you were constructing it, but if not, please ask for an explanation.
    From there it is trivial to find the max and averages.  Connect the output of my code to a for loop.  Inside the for loop, unbundle the array, and compute the maximum and average.  Functions to do these operations on any numeric array already exist (look for Array Max & Min, and Mean).

  • How can i create multiple accounts but use the same itunes?

    how can i create multiple accounts but use the same itunes?

    Hi iCloud is Making Me Go Crazy,
    You will need to create a new Apple ID for your GameCenter and iCloud services.  You can continue to use the current Apple ID you share with your Mom for access to iTunes Store purchases if you wish. 
    Using your Apple ID for Apple services
    http://support.apple.com/kb/HT4895
    Frequently asked questions about Apple ID
    http://support.apple.com/kb/HT5622
    Cheers,
    - Judy

  • How can i create a new item in the app "health"?

    how can i create a new item in the app "health"? I need a field for documentation of "Waist-to-height ratio", exactly for "circumference".
    It's a matter of common knowledge, that the Waist-to-height ratio (WHtR) has more significance then the Body-Mass-Index (BMI).

    If you mean you want to change a color of a calendar category or create a new one, you cannot do that, what is pre-loaded is what you get and cannot be edited.

  • How can i create my own file from the Adobe Export PDF to Word ?

    How can I create my own file from the file of the Adobe Export PDF to Wodrd?

    If there is handwritten content in your PDF then ExportPDF can't convert that to word.
    ~Deepak

  • How can i creat CRC 32 CHECK WITH THE lookup table as attached.

    how can i creat CRC 32 CHECK WITH THE lookup table.attached
    i creat one,but not match the result number C++ version
    result number C++ version:
    FE 00 18 02 40 1E 65 43 00 03 E8        CRC32=>78 1F E9 06
    FE 01 18 02 40 1E 65 43 00 03 E8        CRC32=>F8 8F 49 61
    FE 02 18 02 40 1E 65 43 00 03 E8        CRC32=>7D FF B4 7F

    due to some reason i can not attach the table.but you can find it herehttp://lavag.org/topic/15325-crc32/,it in the CRC.llb 84.03K =>CRC-32 Table.ctl thanks a lot

  • How can I create an internal space from the border in every cell in a table?

    How can I create an space between the text contents and the border inside in every cell in a table in Pages?

    Change the Inset margin in the Inspector palette > T tab > Text

  • UWL Help - How can i create my own task within the Enterprise Portal

    Dear all,
    I am currently working with UWL .
    I have tried the customization and those stuffs associated with UWL , and it is working properly.
    My current issue is , how can create my own task within the Portal ( not using Ad Hoc  Workflow , which is present in Portal) ?.
    If i can create my own task within portal by API or using another method , then How can i add that task link within the drop down box that is present in the Collaboration launch pad and Mytask Workset.?
    Is there any API regarding  UWL (which is useful for creation of custom tasks in Portal using Developer Studio by means of Portal Application Creation) ?
    How can i add that custom task in the drop down ?.
    I have tried the customization of existing UWL.
    I shall be grateful to those who can help me to solve this issue with links regarding the  solution of my problem's.
    with regards
    Kishor Gopinathan

    Hi Kishore,
    I am trying to do the same thing. When i am creating Collaboration Task, it has standard templates in the dropdown like "Single Step" and "Multi-Step" etc., If i want to create my own Custom Task Template and display in that dropdown, how can i do that? Your help is really appreciated.
    Thanks
    Vijay

  • How can I create an audio CD from the audio only portion of my iMovie?

    Hello, I brought in about 50 min of Digital video into iMovie, I separated (split) the audio from the video, I unlocked the audio, I deleted the video, and now I want to just create an audio CD from the audio that is left.
    Can I do this? and if yes how? If I can not, how can I create an Audio CD from on my G5 off a tape on my digital camcorder?
    Any help would be apprecaited.

    This is how:
    Go to:
    'File'
    'Share'
    'Quicktime'
    'Expert Settings'
    'Audio as AIFF' or pick your brand of compression.
    Drag and drop the resulting file into iTunes.
    Enjoy!
    P.S. - You didn't need to delete the video but I think that'll be okay.

  • How can I create side bars without cropping the image?

    I want to create side bars because I am projecting in an vertical panel, but if I crop the image them I only get the middle part of it.
    How can I create side bars in an way that I can still move the image inside?

    On a Video Track directly above the clip(s) you want to have behind the side bars, place a clip of Color (or whatever you want to use for your sidebars).
    Now go to the Effects Tab > Matte >Mask Shape and drag the Mask Shape filter to the Color clip you have placed on the timeline.
    Double click on the clip to open it in the viewer, and click on the Filters Tab.
    Click Invert Box, and adjust the shape to get the side bars you want.
    And now the clip(s) that are beneath this effect will have the side bars and be independent of it, so that you can move them around.
    MtD

  • How can I create 'sub-routines'?

    …, a simplified description what I like to accomplish:
    I'd like to create a generator which lists the, say,  5 (in real: 11...) members of a team:
    1,2,3,4,5
    I'd like to have a drop-down-menu to select from a range of players (A,B,C,D,E,F,G,H), so position #1=player A, #2=C, #3=E, #4=F, #5=B ...
    that's easy .... learned that, did use the 'snapshot' function for a previous version of this generator.
    But!
    next season, it should be a sequence, each player appears after the other (and each item is a short animation, title, fade/in out of pic) - ...
    so, the animation of Player B could appear at 00:10 or 00:20 or 01:40 ...
    It would bloat my Motion project to infinity, if I put ALL player-animations at ANY optional time-line position (and in FCPX, I can select which animation at what time index)... in final version it's 23 optional players at 11 positions of the timeline = 253 'tracks'!
    Question:
    any smart idea how 'link' from the timeline of the Motion-project to some 'sub timeline'?
    in FCPX I would like to see 11 drop-menus; 1-11 defines the sequence of appearance, and I can select at each position any team-member...
    ... hope this makes sense ....
    maybe I'm thinking way too complicated ...
    k.

    Place your players inside a group (called Players). You can arrange the order any way you like, but top down will be more convenient.
    Move the playhead to the beginning, select the top (in the list) player) and type "O" to set an out point. From there, you should be able to hit the down arrow and type I - O to set a one frame in and out for each of the player images.
    Select the Players group and type K to clone it - name it Team. You now have an Image Sequence to work with.
    Replicate the Team image sequence. For each replicator, give it the Position Name. Turn the Shape to Line; Start and End Points at 0,0; Points 1.  Turn off Play Frames in the Cell Controls and use the Source Start Frame to pick the player for that position.
    You can duplicate Replicators (easier) or replicate the Team image sequence.
    Is that about what you wanted?

  • How can I create sub tasks in the UWL

    Hello All,
    I have a requirement where in I am pulling all the SAP Business Workplace notifications into the UWL. In UWL we want to have sub tasks or in other words we want to have selections based on subjects.
    For eg. In SAP if there are three workflows running for three diffrent tasks then in UWL I should have an option to choose among the three and have the notifications based on the selected subject.
    Let me know how this can be done. Looking forward to you.
    Regards
    DK

    Hi Dipendra,
    What i understood from your message is that  if you choose a Task for
    processing then a notification should be sent based on that task Subject
    Is this what you exactly meant or something else.
    plese clarify
    Thanks & Regards
    Hari Sankar M

  • How can I create a status bar at the bottom of a window ?

    I would like to create a status bar at the bottom of my main window similiar to "Internet explorer" has. I thought of using a tool bar but I can't see how to keep it positioned at the bottom of the window when the window is resizable. Any other ideas on how to do this the bar only needs to contain a small amout of text and maybe an icon or two.

    CVI doesn't have a status bar control on UI element like the one available in Visual Studio++. The best way to replicate this is most like through a string control that is resized and positioned to remain at the bottom of the window and colored to look appropriately. I have also seen the combination of a decoration and a text message used.
    Best Regards,
    Chris Matthews
    Measurement Studio Support Manager

  • How can i create multiple apple ids from the same mac

    There seems to be a limit on how many apple ids can be created from the same cpu. Trying to create 100 apple ids for a client to use on ipads distributed to employees i found i could only create three or four before i got the message account cannot be created, contact itunes support. Had the same problem creating multiple itunes accounts through the App Store.

    I found this discussion because I need to create dozens of Apple IDs for the faculty and staff of the school for which I'm the IT Director.
    This is weak.
    Apple, PLEASE upgrade the Apple ID system so it represents the current needs and paradigm.
    What am I thinking, Apple (like Google) don't follow user discussion forums, except by accident when an employee sees something and is motivated enough to carry the water for users in need.

  • How can I create a new color in the calendar?

    Good day,
    I wanted the to create a new color in the default calendar from Apple, but I do not know how that goes.
    Perhaps someone can explain to me how this works.
    I would be very grateful for any advice.

    If you mean you want to change a color of a calendar category or create a new one, you cannot do that, what is pre-loaded is what you get and cannot be edited.

Maybe you are looking for

  • New MBP, old hard drive

    I recently replaced my two-year-old MacBook Pro with a new one. I took the old hard drive (which was not stock -- 320 GB, 7200 rpm) out of the old machine and into the new. Ever since then, random operations result in the spinning beach ball. It can

  • Sony Handycam and MacBook Pro via Firewire 800

    Hi there, I'm trying to connect my Sony Handycam (HC30E) to my MacBook Pro via the Firewire 800 port, but it simply won't register. I bought a cable online that goes from my Sony (iLink) to the Firewire 800 port, so connecivity should be sound - but

  • Disp+work.exe Stopped !!!! ( Hep me please )

    Hello, my dispatcher has failed to start and stops after 1,5 miniutes! How can i resolve the problem? my Message server is running. I have installed 47X200 on win2000 server and MS SQL 2000Ent.Ed. here is my dev_w0 file - trc file: "dev_w0", trc leve

  • Please help-i lost all my songs on my ipod

    Hi, I have an ipod photo which i have had for nearly two years. I had over 400 songs in it. i was listening to my ipod last night on my speakers, and this morning i have tried to listen to it again and all the songs have disappeared. my hard drive on

  • PositivePay interface- EDI 828 / EDI 821

    Hi Friends, We are implementing check issued/check paid process. We are using webmethod as middle layer. The format be are sending to the bank is EDI 828 and receiving with EDI 821 format. Can any one help in finding the IDOC and message available in