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).

Similar Messages

  • 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

  • Unable to create a subsite based on the generic template - save site as a template

    hi,
    am using a  save site as a template functionality to create a sub site. when i select the custom template, and click on ok button,am  getting server error in appln.
    in the site template i have
    1) 2 document libraries with permissions broken[ stop inheritance]
    2) 4  Groups created L1, L2,L3,L4
    am stuck with ,  how to proceed/  create a  subsite based on the  template  site
    note i have uploaded the  wsp file in the new site collection and activated it . ma getting the custom site template name in the tab.
    would like to get clarification  about the  custom permissions:
    if i break the permissions on the document libraries, will this sec.permissions be intact, [ not changed] as the orginal ? i mean if i broke the permissions, in the newly created subsite also, will the permissions be broken? i need this broken functionality
    as per my requirement.
    help is  highly appreciated!
    Das

    hi,
     am not bale to get the correlation id. am getting server error in application. yellow page error!!
    and regarding the permissions i have checked this blog
    http://sergeluca.wordpress.com/2011/06/02/sharepoint-2010-save-as-template-what-is-saved-what-is-not-saved/
    Serge says that, if i am not wrong,
    we cant perform stop inherit the permissions  for the doc lib and create a  sub site based on this site template.
    also if i  stop inheriting from site permissions  also.
    can anyone from MSFT, pls confirm this. or any msd doc says about this.
    Das

  • Get value from the array based on the HashCode

    public static void runJoin(int[][] t1,int[][] t2)
         PrintWriter out=null;
         int rows = 1000;
         int cols = 7;
         int [][] myTable3 = new int[rows][cols];
         int x = 0;
         System.out.print("Running HashJoin:Method loads the "+
         "smaller table in the memory and applies a hashing function "+
         "to common column and stores it in another table. "+
         "The larger table is then read from the file. "+
         "The same hashing function is applied to Col n of the table and a       matching record in the first table is looked up. A match will create a row in Table 3. ");          
    //Apply hashing function to smaller table and store it in the memory.
              Integer[] It2 = new Integer[t2.length];
              int [] hashCodest2 = new int[t2.length];
              Hashtable ht = new Hashtable();
              for(int i =0; i <t2.length;i++){
                   It2[i] = new Integer(t2[0]);
                   hashCodest2[i] = It2[i].hashCode();
                   ht.put(new Integer(hashCodest2[i]),It2[i]);
              //Larger table get hashcodes
              Integer It1[] = new Integer[t2.length];
              int [] hashCodest1 = new int[t2.length];          
              for(int j =0; j <t1.length;j++){
                   It1[j] = new Integer(t1[j][4]);
                   hashCodest1[j] = It1[j].hashCode();               }
              //Based on the hashcode get the value from the Table2;
              try{
    out = new PrintWriter( new FileOutputStream( "c:\\HashJoinTable.txt" ) );
              Enumeration e = ht.keys();
                   while(e.hasMoreElements())
    //How do I get the value from the array based on the HashCode? Do I need to do a loop here???                         
    hashCodes1.get(e.nextElement());           
              }catch(Exception e){}

    ok I got it......
              //Apply hashing function to smaller table and store it in the memory.
              Integer[] It2 = new Integer[t2.length];
              int [] hashCodest2 = new int[t2.length];
              Hashtable ht = new Hashtable();
              for(int i =0; i <t2.length;i++){
                   It2[i] = new Integer(t2[0]);
                   hashCodest2[i] = It2[i].hashCode();
                   ht.put(new Integer(hashCodest2[i]),It2[i]);
              //Larger table get hashcodes and compare
              Integer It1[] = new Integer[t2.length];
              int [] hashCodest1 = new int[t2.length];          
              Hashtable ht2 = new Hashtable();
              for(int j =0; j <t1.length;j++){
                   It1[j] = new Integer(t1[j][4]);
                   hashCodest1[j] = It1[j].hashCode();               
                   ht2.put(new Integer(hashCodest1[j]),It1[j]);
              //Based on the hashcode get the value from the Table2;
              try{
    out = new PrintWriter( new FileOutputStream( "c:\\HashJoinTable.txt" ) );
              Enumeration e = ht.keys();
              Integer t3[] = new Integer[t2.length];
                   while(e.hasMoreElements())
                        t3[x] = (Integer) ht2.get(e.nextElement());                
                        x++;
              }catch(Exception e){}

  • Security based on the position and responsibility of Siebel tables.

    Hi Forum,
    We have a requirement to show some reports based on OLTP (Siebel Base tables with S_) tables. so we have created a repository and created few reports in OBIEE.
    Now we want to implement security based on these tables. Like siebel users will be accessing these reports, So how do we implement security based on the position and responsibility of Siebel tables.
    I request to share any links or docs pertaining to above mentioned implementation.
    Thanks

    Could be interference
    AirPort and Bluetooth: Potential sources of wireless interference
    Try:
    - Reseting the BT headset
    - Reset the iOS device. Nothing will be lost
    Reset iOS device: Hold down the On/Off button and the Home button at the same time for at
    least ten seconds, until the Apple logo appears.
    - Reset network settings: Settings>General>Reset>Reset Network Settings. You will have to rejoin all wifi networs and re-pair all BT devices

  • Is there a way to create a collection based on the "previous import"?

    is there a way to create a collection based on the "previous import"? that would make it easy to mobile sync the last import to my ipad, and do further picking/rejecting while away from my laptop.

    well, yes, of course i could do it that way. i guess i wasn't specific enough. is there a way to create a smart collection, with the photos in the "previous import" as members of the smart collection.  earlier i mentioned about using this smart collection to mobile sync with my ipad, to do further flagging.
    so my intention, use a smart collection to mobile sync with my ipad, and the smart collection to include the photos from my previous import.
    i guess another way to ask the question, is there a way to create a smart collection, by using some rule or condition in the smart collection, to automatically include previous import photos.
    the documentation says that "previous import" is a collection, even though it shows up in the catalogue side bar section. but i see no way to choose that collection when making a smart collection.
    jd

  • Is there an easy way to filter a 2-d array based on the values of two of the fields?

    Is there an easy way to filter a 2-d array based on the values of one of the fields. In my attached VI the output array has the following format:
    TimeStamp        Ident                Frame Type          Bytes    Data
    10:57:07.621   3AD00016   CAN Data Frame   8          0000000000000000
    10:57:07.622   3AD00017   CAN Data Frame   8          000005E000000000
    10:57:07.624   3AD00018   CAN Data Frame   8          0000000003300000
    10:57:07.625   2DC00000   CAN Data Frame   8          0000000000000000
    10:57:07.626   3AD00019   CAN Data Frame    4         0000030000000000
    I would like to delete any rows that do not have an "Ident" between the values of 3AD00000 and 3AD0001E. So for the above data the fourth row would be deleted. The only way I can see to do it is to form a 1-d array. Is there a better approach?
    Thank you.
    Solved!
    Go to Solution.
    Attachments:
    CMM_SN_MULTI.vi ‏20 KB

    Hi chuck72352,
    after you have sorted your data, you can use the InRange Function. Combined with a "search 1D Array" you'll get the range you really want.
    Mike
    Attachments:
    ArraySubset.PNG ‏25 KB

  • How to create a record based on the name of a file in the file-system?

    Hi,
    With a lot of pictures I want to have a database to gather some information about these pictures.
    First question is how to generate a record based on a file in the file system?
    e.g. the pictures are "c:\fotos\2009\01\disc_001.jpg" to "c:\foto\2009\01\dis_98.jpg" .
    now i want to create records with as one of the attributes the name of the picture (not the picture itself). how to create these records (based on the information of the file-ssytem). i.e. the number of records should be the same as the number of pictures.
    any suggestions?
    any reaction will be appreciated.
    Leo

    Link to Create directory
    http://www.adp-gmbh.ch/ora/sql/create_directory.html
    You can create a list of files in the directory and read the list files from that directory.
    [UTL_FILE Documentation |http://download.oracle.com/docs/cd/B14117_01/appdev.101/b10802/u_file.htm#996728]
    [Solution using Java|http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:439619916584]
    SS

  • Deleting data from a 2D array based on the id of the second column

    Hello
    I hope someone can help me. I have come across a hurdle in the programming of my application.
    1.
    I have a 2D array, the first column of this array contains my data and the second column contains an id, which is either 0 or 1.
    I have sorted this 2D array based on the id column so that the data corresponding to the 0’s is on top part of the array and the data corresponding to the 1’s follows it (on the bottom of the array).
    I want to delete that data (rows) of this sorted array that correspond to the 1’s and keep only the data (rows) that correspond to the 0’s.  
    So I would end up with a new 2D array that has only the data that I want on the first column and 0’s on the second column.
    I have hundreds of these 2D arrays resulting from my program (using a for loop) hence I want to automate this procedure. The length of the selected data arrays will vary.
    2.
    Once I can do this I will want to remove the id column (with the 0’s) from the 2D array and would like to build a new array with only the data from the first column (which may be of different length).
    So I want to end up with a 2D array with columns corresponding to the selected (1st column) data from the (original) 2D arrays. These data may be of different lengths so when building this new array I may need to do some padding. Will labview do this automatically?
    I hope that this is clear.
    Best wishes,

    Attached is a different approach - you don't need to do any sorting.
    The outer FOR loop assumes you have all the arrays available at once. If you are reading a file, modify it accordingly.
    You may or may not want the TRANSPOSE function on the final results, depending on what you want to do with it.
    Yes, when you assemble N-dimensional arrays into (N+1)-dimensional arrays, LabVIEW automatically pads for you.
    Enjoy.
    Steve Bird
    Culverson Software - Elegant software that is a pleasure to use.
    Culverson.com
    Blog for (mostly LabVIEW) programmers: Tips And Tricks
    Attachments:
    Extract Marked Data.vi ‏40 KB

  • Mail does not create new emails based on the highlighted mailbox, but rather the receiving mailbox of whatever individual email happens to be highlighted. This was not the case prior to Lion. Is this a bug or an error on my part?

    Mail does not create new emails based on the highlighted mailbox, but rather according the receiving mailbox of whatever individual email happens to be highlighted. This was not the case prior to Lion. Is this a bug or an error on my part? (I do have the setting for creating new emails from the highlighted mailbox checked.)

    The questions about time was not only because of thinking about the Time Machine, but also possible impact on recognizing which messages remaining on a POP server (doesn't apply to IMAP) have been already downloaded. In the Mail folder, at its root level, in Mail 3.x there is a file named MessageUidsAlreadyDownloaded3 that should prevent duplicate downloading -- some servers may not communicate the best with respect to that, and the universal index must certainly be involved in updating that index file. If it corrupts, it can inhibit proper downloading. However, setting the account up in a New User Account and having the same problem does not point that way, unless your POP3 server is very different from most.
    That universal index is also typically involved when messages are meant to be moved from the Inbox to another mailbox -- in Mail 3.x the message does not move, but rather is copied, and then erased from the origin mailbox. That requires updating the Envelope Index to keep track of where the message is, and should keep track of where it is supposed to have been removed after the "Move".
    Ernie

  • Sorting an array based on the value of another array

    Hi
    Ive got 2 arrys... An Integer[]{11,12,23,24,25};
    and another one double[]{60,79,83,54,67};
    i wanna sort the first array based on the values of the second array..
    ie my result should be double[]{83,79,67,60,54} and
    Integer[]={23,12,25,11,24}...........
    is thr any easy method to do tis..

    You should make a class with the int and the double as fields; and have your class implement Comparable to compare on the double the way you want; and just have an array of objects of this class, and sort it.
    Because the corresponding elements in your arrays are essentially linked, so they should be together.
    Edited by: spoon_ on Apr 12, 2008 2:17 AM

  • How to create activity workflow based on the Web API 2 services

    Hi,
    We have Web API 2 services and we want create activity workflow based on the Web API 2 services.
    Web API 2 services provide some application operations and based on this operations we would like to create custom activity workflow.
    Question:
    Is that possible?
    Could you please give best practices to create activity workflow based on the Web API 2 services ?
    Thanks for your support.

    HI Max_P,
    Welcome to workflow forum.
    ASP.NET Web API is a framework that makes it easy to build HTTP services that reach a broad range of clients, including browsers and mobile devices. ASP.NET Web API is an ideal platform for building RESTful applications on the .NET Framework.
    I researched relevant topic about creating workflow application using Web API 2, I just found these resources about it.
    Learn About ASP.NET Web API
    Hope it helps.
    Best regards,
    Angie
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • How to create a diagram based on the query?

    Hi All,
    I want to create a diagram which will show a structure based on the data in the tables.
    For example:-
    if in a table, we have on two columns,
    one have unique breed of animal and other columns have sub-breeds under that breed. it is one to many mapping.
    in some other table,we have on two columns,
    one have unique sub-breed of animal and other columns have again sub-breeds under that breed. it is one to many mapping.
    i want to display the diagram as shown at the following url:- http://www.signosemio.com/a_analyse-par-classement.asp (diagram:- The naïve ontological classes)
    At the place of Boxes, i will show images.
    but i am not able to generate this diagram.
    please help.

    I am afraid, the Google Visualization plugin (which is used internally by that apex plugin) does not support multiple parents.
    The documentation page says the following
    Each node can have zero or one parent node, and zero or more child nodes.I tried adding an extra row for a child with an additional parent, but it removed the old parent association for that record in the chart
    You might have to some other plugin which supports that or find an JS/jQuery plugin that renders as per your requirement and then write the code yourself to pass the data to JS function from the page.

  • Sub totals based off the value of a dimension

    Hi,
    I have a requirement to apply sub totals to a dimension at certain levels of a hierarchy.
    From what we've implemented, the typical Level-Based Hierarchy has been replaced by a Flat Hierarchy, so instead of accounts appearing at different levels and in different columns (I.E Level 31, Level 30, Level 29 ... ), they appear in 1 single column. A seperate column called Node Depth determines the level at which these accounts sit.
    Essentially, I just want to show sub totals for values 2 and 3 in the Node Depth column.
    Is there a way to do this in OBIEE? I've only been able to get ALL subtotals to appear.
    Thanks

    Hi Chris,
    You can either use the FILTER...USING... function in answers or you can create distinct, filtered LTSs in the RPD which will then represent your node depth. I.e. you'd have, in your example, 8 LTSs with differing fragmentation content of "Node Depth" = 1 ... = 8

  • Creating Outbound deliveries based on the sales order schedule lines

    Dear all.
    Is it possible to create outbound delivery documents based on the sales order schedule lines?
    Eg:
    Let's say I have sales order line item 10 with below mentioned requested delivery dates in its schedule line level.
    30.07.2009
    10.08.2009
    20.08.2009
    30.08.2009
    Will it possible for me to create different deliveries for those 4 schedule lines individually? I should be able to create 10.08.2009 delivery without clubbing 30.07.2009 delivery with it.
    Appreciate your help!

    I'm not sure because I'm not before SAP but try transaction VL10E that is to create delivery for schedule lines. I'm not sure what are the split criterias.
    Please check OSS note 113411 tha has many OSS note reference in this subject.
    Regards,
    Csaba
    Edited by: Csaba Szommer on Jul 29, 2009 2:38 PM

Maybe you are looking for