Arrays, arrays !!! Manipulating

Hello all,
Just a thing I don't understand :
I use a VI that returns arrays (1D and 2D).
I use it in a For Loop, so I get all the arrays when the loop exits.
1D arrays are stacked in a 2D array and 2D arrays in a 3D array.
How can I extract my 1D and 2D arrays in another VI ?
Bruno Colombet
Neurophysiologie et Neuropsychologie
INSERM E9926
Faculté de Médecine
27 Bd Jean Moulin
133385 Marseille cedex 05

You can use Index array function, if you want to extract a
1D array from a 2D array, wire the 2D array to the input
and if for example, you need the first row of that 2D
array, wire a 0 to the index first value, add another index
value and disable indexing by right-clicking on it. In the
output, you'll get the first row of your 2D array, as a 1D
array. In case you need to extract columns, use the first
index empty and disabled, and wire the position you want in
the second. In a 3D array is the same but with 3 dimensions.
Hope this helps, if not, ask again.
Best Regards
Gorka Larrea
[email protected]
* Sent from AltaVista http://www.altavista.com Where you can also find related Web Pages, Images, Audios, Videos, News, and Shopping. Smart is Beautiful

Similar Messages

  • Noob needs help with array manipulation

    First off, I'd like to say hello to eveybody!
    I'm trying to figure out how to search for a value in an array, delete the first occurence of it, and shift the rest of the array down one. Can anyone point me in the right direction of an algorithm, mabey?
    Any help is most appreciated!

    first of all, let me comment that for this purpouse, you're better using the ArrayList class.
    anyway, you would need to make a temporary array inside a method, and traverse the array in question using a loop. most people use a for loop.
    Then, put all the values of the old array into the temporary one, except for the one you dont want.
    after the loop, set the old array to equal the temporary array.

  • Skewing in a 2D array manipulation

    I have an application that forms a 256 x 256, 2D array arrangement of data measurement points from a 1D array bin 256 elements long.I use a rotate VI to shift the incoming points in and predefined 2D arrays which is initialized to zero at start-up. I can't figure out that the 2D final output is shifted and skewed.Also, I simulate the data source from another loop and uses a Notification.VI for synchronizing the receiver and data source loops; a marker 255 is used to mark end and start of new data stream.
    Bernardino Jerez Buenaobra
    Senior Test and Systems Development Engineer
    Test and Systems Development Group
    Integrated Microelectronics Inc.- Philippines
    Telephone:+632772-4941-43
    Fax/Data: +632772-4944
    URL: http://www.imiphil.com/our_location.html
    email: [email protected]
    Attachments:
    array_processing_xy-scanner_beta_test_notifier.vi ‏192 KB

    Hello Sean, thanks. You were right about how arrays does its job, before this reply I had already figured out the bug in the code.First, is that you would'nt really like to have any time delay VIs lying around unwatched because they mess up synchronization VIs (Queues,Notifications)between deep nested loops.It is important to check which index to use for counting the element arrays, this was a key in the debug. The skewing of the bits has pointed to the consumer loop index not neing synchronized with the producer loop. Overall the array does its job only when indexed right probing tools has been very valuable for tracking the data elements.Attached is the screenshot of the actual project GUI.
    Bernardino Jerez Buenaobra
    Senior Test and Systems Development Engineer
    Test and Systems Development Group
    Integrated Microelectronics Inc.- Philippines
    Telephone:+632772-4941-43
    Fax/Data: +632772-4944
    URL: http://www.imiphil.com/our_location.html
    email: [email protected]
    Attachments:
    one_line_scan_screenshot.GIF ‏276 KB

  • Best Way to do this array manipulation

    I have an array as follows:
    61 3 51 5 61.2 3.4 51.3 4.3 61 7 51 4
    where the data is in sets of two so array[0] and array[1] make up one data set (61,3) and the next data set is (51,5) then (61.2,3.4) ect. What I want to do is to clean this array up so that any data set where the X values are within some set value, say 1 then they are seen as duplicates and removed, unless the y values differ by more than 1. So for example this set would clean up to
    61 3 51 5 61 7
    Is there any nice way to do this in labview?
    Thanks.
    Intern NSWCCD Carderock.

    I tried to use the following VI but it doesnt seem to work, any suggestions? Thanks.
    Intern NSWCCD Carderock.
    Attachments:
    try.vi ‏82 KB

  • [Solved]Bash:Manipulating arrays of paths? the right way or not?

    Note: Refer to the following posts for better solutions and/or alternatives.
    This is a mock segment of a script I'm writting and I need to know if I'm doing it the correct way or at least in a proper bash way...
    the following works but will it always parse in a sorted manner. I have a set of directories that are named by date in the YYYY-MM-DD (International) format and want to be sure that they will always be treated as directory paths even when special characters "\n,\t,\s ...etc" are encountered in the path. The number of these directories changes and is compared to a set NUM-ber variable and when there are more than the set number the oldest ones are removed which brings a second question. Being dated as YYYY-MM-DD they sort from oldest to newest(lexicographical order) but do they always and is this the right way to deal with elements in an array separated by nulls? Any Comments or suggestions would be appreciated as I'm learning bash for the  time being (perl is next) and gathered this from bits and peices on verious wikis and forums. I basically want know if this a correct approach to the subject of extracting and performing actions on elements of an array that are directory paths.
    #!/bin/bash
    oifs="$IFS"
    IFS=$'\0'
    DIRTREE=(/path/to/dated/directories/[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]/)
    NUM=5
    HOWMANYMORE=$(echo $(( ${#DIRTREE[@]} - $NUM )))
    if (( ${#DIRTREE[@]} > $NUM )) ; then
    rm -rv "${DIRTREE[@]:0:$HOWMANYMORE}"
    fi
    IFS="$oifs"
    Note:I have tested this for those wondering
    Last edited by Thme (2012-11-30 16:58:13)

    aesiris wrote:
    there is a special syntax for appending elements to an array:
    array+=(element1 element2 ...)
    you can simplify to
    NUM=3
    combined=()
    for dir in set1 set2 set3; do
    new=(/home/maat/dateddirs/"$dir"/[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]/)
    (( count= ${#new[@]} - NUM ))
    combined+=("${new[@]:0:$count}")
    done
    This works as really well, however, in my case I still need the other sets in separate arrays for other purposes in my personal script so I adapted the approach a little and got this which uses the array+=(foo) syntax properly now. I was aware of this feature in bash arrays and experimented with it but had no success adding elements from other arrays until you demonstrated it in your example by adding them though a "for loop" and doing the arithmetic there... My current one now is very similar...I'm not sure how to reduce it further if possible but I need the other arrays as I do something completely different with them:
    #!/bin/bash
    NUM=10
    set1=(/home/maat/datedfolders/set1/[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]/)
    set2=(/home/maat/datedfolders/set2/[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]/)
    set3=(/home/maat/datedfolders/set3/[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]/)
    CT1=$(( ${#set1[@]} - NUM ))
    CT2=$(( ${#set2[@]} - NUM ))
    CT3=$(( ${#set3[@]} - NUM ))
    for X in "${set1[@]:0:$CT1}" "${set2[@]:0:$CT2}" "${set3[@]:0:$CT3}"
    do
    combined+=("$X")
    done
    for
    for Xdirs in "${combined[@]}"
    do
    rm -rv "$Xdirs"
    done
    I'm considering changing the title of this thread as it reveals a little more than I originally expected to go over and provides some pitfalls as well as ways to approach array manipulation which can be applied to wide range of uses in bash scripting. Others may find totally different uses for what we've discussed here so....
    Last edited by Thme (2012-11-30 10:41:02)

  • Manipulation array

    Ok well,
    I`m currently block on one simple problem, But I don`t find the solution......... And sure it is simple....
    It`s easier with one drawing, I want to do this :
    1 1
    2 2
    3 3
    4 4
    5 5
    6 6
    And want to change the array to have :
    1 1 4 4
    2 2 5 5 
    3 3 6 6
    I found this post
    http://forums.ni.com/t5/LabVIEW/array-manipulation/m-p/2871852/highlight/true#M835498
    I don`t have lbview 2012 but one older version, I tried to play with shifts register and build array, but I`m a little lost.
    If someone has the solution, it`s welcoming.
    Solved!
    Go to Solution.

    You can use Insert Into Array in order to combine 2D arrays "next to each other" instead of "on top of each other", allowing you to simply split the array and then recombine:

  • All the xml and arrays are getting NULL Problem

    Hello guys
    I am working on a project which uses xml loading, e4x and array manipulation extensively, and it was going good but now I got stuck on a strange problem.  Whole code was fine and application was working and responding in a desired way, but then mystourisly it stopped working and started to retun NULL values to almost all the actionscript (internal) Arrays and XML varibales.
    Now Whenever i load xml file and assign the loaded values to internal xml variables, internal values get only NULL instead of data.
    Same is the situation with Arrays, I created some components in mxml, and when i passed them to arrays by reference, code gets compiled successfully, but again Array has only null values [that code was working fine too]
    I am wondering if Adobe Flex did a silenced update or something similar and it is the result of that things !
    I am using Adobe Flex 3.2 with SDK 3.3 on windows Vista Ultimate.
    Please check this attached project, Import it and see if you face the same problem
    Thanks
    Link to Problem Project
    http://isolatedperson.googlepages.com/problemXperiment.zip
    Problem Screenshot
    http://isolatedperson.googlepages.com/xmlissue.JPG

    Use HTTPService to load the data. You'll have fewer problems.
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application creationComplete="dataSvc.send();"
      xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
         <mx:Script>
              <![CDATA[
                import mx.collections.XMLListCollection;
                import mx.rpc.events.ResultEvent;
                [Bindable] private var xlc:XMLListCollection;
                   private function loadXML(evt:ResultEvent):void{
                    xlc =  new XMLListCollection(evt.result.individual.@id as XMLList);
              ]]>
         </mx:Script>
         <mx:HTTPService resultFormat="e4x" result="loadXML(event)" url="alirazaTree.xml" id="dataSvc"/>
         <mx:ComboBox id="cbx" dataProvider="{xlc}"/>
    </mx:Application>

  • Array Processing in Forms 6i

    I am developing a common function in a PLL library that requires data from a calling form to be retrieved into temporary arrays on which some processing and calculation takes place and the resultant data is inserted into the destination table.
    In order to do this array manipulation and processing, I know of three options :
    1. Table Type
    2. Record Group
    3. Temporary Tables.
    Which is the best option to use in terms of
    1. Processing speed ,
    2. Client load ,
    3. Server Load,
    4. Multi user processing ,
    5. Re-usability,
    6. Forms 9i compatibility,
    7. Database Interactions
    If there is any other option, apart from the three above, please point out that too. Thanks in advance.

    If you are extracting the data and processing it all from one form, I would use a pl/sql table (Table Type). The coding would be easiest.
    A server side temporary table would give you SQL functionality, but would be much slower than a stand-alone client-side table.

  • How to create a vi that can be connected to any type of array

    I would enjoy to create a vi that can perform an operation (like resizing) on any type of array (array of string, of cluster, of num,...): Which type of control or indicator could I use for this purpose? Any Idea?
    Thank's for your help

    Olivier,
    to do this you have to use a variant input. You can wire any type of data to a variant input. Inside the VI you flatten the variant to a string. The flattened string of an array contains both data and length of the array. You reshape the array manipulating the string. When done, you unflatten the data to a variant and output it from the VI. The caller has to convert the variant input to the source array type. OpenG.org provides a quite extensive toolkit to manipulate variant data. Some VIs specifically manipulates arrays. To see a description of VIs go to : http://opengtoolkit.sourceforge.net/lvdata/index.html
    LabVIEW Data Tools can be downloaded from http://sourceforge.net/projects/opengtoolkit/
    You need both packages lvdata AND error.
    LabVIEW, C'est LabVIEW

  • Array manipulati​ons...

    Hi
    I would like some help with array manipulation
    I have multiple  files (1000 text files) with 5 columns each and 20,000 rows. The first row of each file has a header that labels the columns.
    I would like to be able to read each of these files, pull out colum 3 from each file and then build these into a new 2D array. It would be nice if they also had their corresponding header labels. So then I would end up with the new 2D array containing 1,000 columns (corresponding to column 3 of each of my 1000 files) with 20,000 rows plus a first row with the header labels.
    I would also like the option to in future select column 2 for example, or column 5; plus I would also like the functionality to allow me to perhasp pull out more than one colum, e.g. colum 2 and 3, before we build the new array.
    I hope I made some sense and that someone can help. Thanks you

    Oh nuts! 
    While I was trying link those posts to give a heads up to the forum I had a sinking feeling that I was going to get it all wrong.
    I need to be more mindful of my feelings ....
    cheers
    David

  • Efficient (Semi) Large Array Data Set Manipulation

    Hi Everyone.
    I am trying to figure out the most efficient way to manipulate somewhat large array of data (up to about 120 Megabyte) that I am currently getting from a FPGA. This data represent an image and it need to be manipulated before it can be displayed to the user. The data need to be unpacked from a U64 to I16 and some of it need to be chopped (essentially chop off 10% on each side of the image so if an image is 800 x 480 it becomes 640 x 480).
    I have tried several approaches and the image below show the one that is the quickest but there might be further optimization that could be done.
    I am looking forward to see what other can come up with.
    Note 01: I am including a link to the benchmark VI that has a quite large image in it so this VI is about 40MB.
    Note 02: this is cross-posted on Lava
    Thanks
    Attachments:
    BenchmarkImageDataManipulation.png ‏68 KB

    johnsold wrote:
    Using Array Subset rather than Reshape Array to truncate the 1D array is faster: 151 ms compared to 175 ms. 
    Lynn
    Thanks Lynn, this is good to know!
    Unfortunately the solution in this frame is still about 2x slower than the faster one (the "Reshape & Chop & Reshape & Unpack & Reshape").
    PJM

  • Performance issues in manipulating class references in a array

    Hi,
    just to make things clear, the issue is noticed from my part because i retrieve a list of instances located in a array to manipulate them in a variable holder. Normally, the operations can be made between two instances stored in a simple variable to variable fashion and it works realy fast.
    I analysed two main operations: retrieving references in a array to a variable and get or set a value from the variable reference.
    Here are the objects used to perform the test operation:
    var v4:Vector.<Person>= new Vector.<Person>();//List of Persons instance
    var refHolder:Person; //Typed reference
    var refHolder2:*;   //Not typed reference
    Test #1: looping 200 000 times and only retrieving references from the array v4.
    Typed reference
    Not typed reference
    4ms with approx 436 893 intructions per ms
    2ms with approx 436 893 intructions per ms
    436893 * 4 / 200 000= 8.8 instructions with loop to perform the retrieval
    436893 * 2 / 200 000=4.5 instructions with loop to perform the retrieval
                         Test #2: looping 200 000 times, retrieving references from the array v4 and getting a value from the instance.
    Typed reference
    Not typed reference
    4ms with approx 436 893 intructions per ms
    11ms with approx 436 893 intructions per ms
    436 893 * 4 / 200 000= 8.8 instructions with loop to perform the retrieval
    436 893 * 11/ 200 000= 24 instructions with loop to perform the retrieval
    So my conclusion with that test is that with a typed reference you spend more time assigning a reference than manipulating a value from the reference
    With a not typed reference, the time spent is in manipulating the reference in the variable.
    Which one should i use or what should i do to have better performance with manipulating references from arrays?
    Here are the files i used to test this:
    reference.swf     //Online example
    reference.zip     //Source file
    Dominik

    Hey,
    Here's what I think the problem is:
    As long as you do not interrogate your refHolder variable for its properties or methods, Flash won't give a damn about it's type (that's why case 2 runs good when you dont't try to get .num property).
    But, if you do want to get some values from it and if Flash does not know which type, then Flash has to go and find the referenced class (going backwards through v4 array to find out that values stored in it are Person type, then finding the Person class to find out the .num property, etc...).
    As for the first test case (looping being faster with a non-typed), the few ms you are gaining there are only because Flash doesn't register the Person class because you don't tell him. But as you can see, it takes him only 2ms, which is not much.
    So, considering that Flash registers a class in just a few ms IF you tell him, it should be way more performant to do so (in the case you do want to retrieve values..) than letting him guess 200 000 times the same thing (because of course it will search for that class ref each time it goes through the loop..).
    So my advice for you is that if you are going to do something with those Person objects inside the loop, let Flash know their reference class..!

  • Pointer Manipulation: Wrap Around/Rollover/Rotation of LabVIEW Arrays and Waveforms???

    I know we can't use pointers in LabVIEW, but I was wondering if there's any way we can do wrap-around [or "rollover," or "rotation"] of Array [or Waveform] values without having to make copies of the Array [or Waveform]?
    For instance, suppose I'm reading one second's worth of data into a five second buffer. After the first five seconds, I've got
    1st (1/5)th: 1st second's worth of data
    2nd (1/5)th: 2nd second's worth of data
    3rd (1/5)th: 3rd second's worth of data
    4th (1/5)th: 4th second's worth of data
    5th (1/5)th: 5th second's worth of data
    Now I read the sixth second's worth of data, and overwrite the [original] first second, so that I have
    1st (1/5)th: 6th second's worth of data
    2nd (1/5)th: 2nd second's worth of data
    3rd (1/5)th: 3rd second's worth of data
    4th (1/5)th: 4th second's worth of data
    5th (1/5)th: 5th second's worth of data
    and in C, or C++, I'd just move the pointer up to the second (1/5)th of data, and start from there.
    The LabVIEW Complex FFT is another place where this would be really useful. The Help File for the Complex FFT is in
    Help | VI and Function Reference | Analyze VIs | Signal Processing VIs | Frequency Domain VIs | Complex FFT.
    If you read the Help File, you see that LabVIEW returns an FFT with values in the range
    [0, 2n - 1)
    rather than the standard
    [-n, n - 1)
    i.e. LabVIEW takes the negative frequencies and tacks them on at the end, after the positive frequencies.
    I'd like to be able to view my FFTs with the negative frequencies where they're supposed to be [i.e to the left of zero], and this would be SO easy if I could just move the underlying data pointer of the Waveform forward to the halfway point.
    But, of course, in LabVIEW, I don't have pointers, so I was wondering: Are there any built-in VIs for Array [or Waveform] manipulation that will perform this sort of wrap-around [or "rollover," or "rotation"] of the data? If so, I couldn't find them. Ideally, such a VI would have two inputs: {old Array, new starting point}, and one output: {new Array}. Similarly with Waveforms, only you'd need to manipulate t0 as well.
    Or do I have to copy the entire data set to a new Array [or Waveform] each time I reach the end of the buffer?
    Thanks!

    > Ideally, such a VI would have two inputs: {old Array, new starting point}, and one output: {new Array}.
    Have a look at "rotate 1D array" in the array palette (second row, fourth column).
    (Sorry, I dont use waveform data).
    LabVIEW Champion . Do more with less code and in less time .

  • Manipulating Arrays

    Hi I am having trouble with 2D arrays.
    public class cross{
    public cross() {
    A = new String[3][];
    A[0] = new String[3];
    A[1] = new String[3];
    A[2] = new String[3];
    for (int i = 0; i < 3; ++i) {
    for (int j = 0; j < 3; ++j) {
    A[i][j] = "Empty";
    Is there anyway i can define a method which makes it possible for me to change the values of a specific element?

    Hi I am having trouble with 2D arrays.
    public class cross{
    public cross() {
    A = new String[3][];
    A[0] = new String[3];
    A[1] = new String[3];
    A[2] = new String[3];
    for (int i = 0; i < 3; ++i) {
    for (int j = 0; j < 3; ++j) {
    A[i][j] = "Empty";
    }What I am trying to say is that how do i come up with a method, for e.g. changeCross(int x, int y), where x and y will go into A[x][y] and thus I am able to change the value for that particular element. Remember cross is not an array object. Is my concept of array and classes wrong?

  • Manipulating java array object in an oracle procedure

    hi there,
    i have a java store procedure that returns an array of filenames, and i have an oracle stored procedure that will for each filename returned in the java array object, open that file do some processing and load the data into database tables, now my question is, would an oracle 9i varray object be compatible with a java array, or should i pass in a pl/sql table to store the filnames returned?
    i really am stuck at this point and need help !!!!
    Thanx

    Wole,
    Have you searched the code samples available at the Technet Web site? Could you not find a relevant one?
    Have you tried searching the Ask Tom Web site?
    Good Luck,
    Avi.

  • Regarding Array to Multicolumn Listbox data's manipulation

    Hi  - I want to display the above mentioned array in muticolumn listbox with 2 columns , first column needs to be belongs to array [0] (Date and time ) and second column needs to be belongs to array [1] and array [2] ( Cone and Vane strings).
    I have tried to implement the same, please go through the attached VI and I cannot make the above mentioned array data's into two column multi column listbox data's (that is , can't able to display the array [1] and array [2] data's in single column.
    Please let me know the solution to resolve this as soon as possible.
    Thanks and Regards,
    Dinesh
    Attachments:
    Cone and Vane Operations_Final.vi ‏60 KB

    Well, your VI is a complete mess and has several CPU burner loops that run as fast as the computer allows. There is also a lot of duplicate and overly complex code. Programmed correctly, code with all this functionality could probably fit on a postcard.
    Anyway, for just building the multicolumn listbox, here's somewhat simpler code. Hopefully you can adapt it to your problem.
    Note that you probably want to add only one row at a time, and you only want to add to the listbox and save to the file when new data arrives and not millions of times per second. Try a queue, for example.
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    Cone&Vane.vi ‏8 KB

Maybe you are looking for

  • Help with exporting to WHCC using Lightroom

    Please help!  My brother (professional photographer) is on a 6 month kayak trip and I've been left in charge of 20 years of photography!  I have detailed instructions on how to export photographs from the external hard drives, to an online company wh

  • Everything is so slow after I updated to 10.7.2...Help:(

    I have a Macbook pro 15''.. Bought this Aug. Everything is so slow after I updated to 10.7.2 ..... Especially now it takes me 1 min to turn on my laptop... which used need only 10 sec. So does Turn off...before update it is 2 sec, now it is 30 sec...

  • Corruption of desktop and more

    Greetings, I installed a complete new system 10.4.8 After doing this I have little problems. For example I cannot change the background colour of the desktop. Or if I have 2 windows open lets say Safari and Word and I want to go from Word to Safari I

  • IDoc  in Ststus 51

    Hi   One of our customer sends requested delievery date at item level. So when PO comes in the IDOC is errored out at status 51 and giving us the following message: Field RV45A-ETDAT (1) does not exist in the screen SAPMV45A 4001 Any help is highly a

  • IPod keeps turning itself on and off after attempted update

    I attempted to update my iPod touch 4 from iOS 5.0.1 to iOS 5.1 but now my iPod keeps shutting itself off and turning itself on.