Delete Array

Hello.
I have a array and from which at some specific index i need to delete small portion of array like:
0 pass
1 pass
2 fail
3 fail
4 pass
5 fail
6 fail
no i have to delete  from above array, 1st three elements then two elemets and last remaing two elements which i am not able to do using delete array icon.
So if anyone can help me.
Thanks
Solved!
Go to Solution.

Well, if you run your VI in highlight execution mode, you will probably see that it is not doing what you want from the get go.  Why are you wiring the start index and the length to the same value?  Have you looked at the help file dor the function and understand how it works?
In your example, your first pass will delete 4 elements from the array starting at index 4, so indices 4, 5, 6, and 7.  Your start indices and lengths probably need to be different values.  Next, the way you are doing it, realize that your starting indices will continue to change.  You will probably want to do it backwards, so the end of the array is changing, not the beginning.  Then, you won't need to dynamically modify the indeices.

Similar Messages

  • Please Help me on recreating deleted arrays

    Hi,
    I'm trying to recreate a deleted array as follows:
    array=null;
    Array array[] = new Array[100];
    addToArray("elem1","elem2","elem3");
    but doesn't work. I'm unable to recreate/populate the array. Can someone please help me with this?
    I declared the array null first because the array was previously existing.
    What I need to do is to be able to add array elements dynamically and delete some at the same time.
    Deleting some elements seemed to be a complicated process so I thought of deleting the entire array instead then just recreate it and populate with required elements. I should keep the same array name.
    Thanks!
    Anna

    array=null;
    Array array[] = new Array[100]; // on this line you declare the variable array once again : the compiler doesn't accept it.
    addToArray("elem1","elem2","elem3");
    What I need to do is to be able to add array elements
    dynamically and delete some at the same time. You can also give a look at the Collection
    http://java.sun.com/docs/books/tutorial/collections/implementations/general.html
    and especially the class "ArrayList" http://java.sun.com/products/jdk/1.2/docs/api/java/util/ArrayList.html
    This class provides methods to add, delete element and dynamically enlarge the array.
    Good luck

  • Delete array icon won't expand

    Hi,
    Does anyone have problem with "delete array" icon that won't expand to accept more indexes?  From the Context help, it shows the delete array icon as expandable, but it won't work.
    thanks,
    atd
    Solved!
    Go to Solution.

    No, the node is not expandable. I guess the image in the context help indicates how the node adapts to higher dimension input arrays.
    Having the node expandable would be very dangerous because the indices assigned to elements of course change with every deletion. If you need to delete many sections, htere are much better ways to do this. "Delete from array" should typically not be used repetitively (e.g. in a tight loop).
    For some better ideas, have a look at this post. As you can see here, doing it efficiently can be orders of magnitude faster. Is your array 1D, 2D or higher?
    LabVIEW Champion . Do more with less code and in less time .

  • Recreating Deleted Arrays

    Hi,
    I'm trying to recreate a deleted array as follows:
    array=null;
    Array array[] = new Array[100];
    addToArray("elem1","elem2","elem3");
    but doesn't work. I'm unable to recreate/populate the array. Can someone please help me with this?
    Thanks,
    Anna

    I'm not sure what your problem is here...
    Your user defined class:
    public class MyArray {
       private double x;
       private double y;
       private double dx;
       private double dy;
       private boolean fixed;
       private String lbl;
       ... setters/getters
    }An arrayList of your class:
    ArrayList list = new ArrayList();
    list.add(new MyArray());
    MyArray element = (MyArray)list.get(0);Where's the problem?

  • Deleting array elements

    Hi!
    I have a problem with my program. i have an array and in this array a several numbers. With the "In Range and Coerce" function i want to prove if the the array element is inside or outside of my limitations. If my array element is in the outside of my limitation, the code in the case structure should delete this element.
    I need this program, because the array is displayed on a graph and i want only display the date, which is in the limitations.
    I hope somebody could help me!
    Best regards,
    Peter
    Labview 7.1 on Windows 2000
    Attachments:
    array.jpg ‏54 KB

    Hallo Peter
    Das Problem tritt auf, weil du immer wieder das selbe Array liest.
    Die Knoten am Loop sollten Shift-Register sein, damit das Array, bei dem das Element gelöscht wurde, bei der nächsten Iteration gelesen wird. Allerdings musst du dann auf einen While-Loop umstellen, da du ansonsten Elemente lesen willst, die es im Array nicht mehr gibt.
    Anbei eine mögliche Lösung.
    Hoffe es hilft weiter.
    Thomas
    Using LV8.0
    Don't be afraid to rate a good answer...
    Attachments:
    RemoveElements.vi ‏32 KB

  • Deleting array element

    Hi,
        I am getting an array of 100 elements and i need to delete the the element if it contains 255.And most importantly the next element should be placed in its place.So if i get 30 255s then my output array should get reduced to 70.I tried search 1d array but it is returning only the index of first element containing 255.Please help!!!
    Solved!
    Go to Solution.

    Hi muks,
    i think i understand what you mean, but i have to create a test array to work with. Attached you can see another way to delete the 255 without using a loop.
    Mike
    Attachments:
    Unbenannt 3.vi ‏13 KB
    Remove_Element_from_Array.vi ‏14 KB

  • Delete Array Duplicate for only one column

    Hi all,
    So I am trying to work out a problem here. I have searched the forums but I have not found anything that works for me. Here is my issue.....I have an array (converted from a .csv file) with many rows and columns. Each row is a logfile for a particular serial number. The amount of columns is fixed. But, I need to create a vi to go through the array and remove the duplicates below the original and create a new array.. For example, my array could look like this (I added a desc header for clarity):
    Job, Tech, SN
    1827, SJ, 23827
    1825, SJ, 23827
    1827, SJ, 47384
    1827, SJ, 57483
    1827, SJ, 37473
    1825, SJ, 37473
    But i want an appended array like this:
    Job, Tech, SN
    1827, SJ, 23827
    1827, SJ, 47384
    1827, SJ, 57483
    1827, SJ, 37473
    Can anyone help me out?
    Thanks,
    Ryan
    Solved!
    Go to Solution.

    Assuming that the identical serial numbers are adjacent as in your example, here's what I would do.
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    RemoveDuplicates.png ‏22 KB
    removeDuplicates.vi ‏11 KB

  • Deletion of arrays during specific time intervals...how to get it working?

    i am trying to calculate the average peak values in a systolic pressure waveform during a specific time interval. for example, every 5 seconds, i want to average out all the peak values in that interval and after calculating the average, i want to delete the array of peak values. however, what i am finding is that the array is always 0 if i use the delete array in my vi. therefore, the average is always NaN, because the array is empty and there is a divide by 0 error....
    what should i do? i have been stuck on it for a long time now, thankyou very much"
    Attachments:
    help.vi ‏57 KB

    It is very difficult to make sense of your diagram, because all the control references are missing, so it is not possible to tell the various data sources apart.
    Where is the data coming from? How do you prevent race conditions between the acquisition and analysis parts?
    Overall, the diagram is overly complicated and very hard to read. For example clearing the array does not require reading the old array, measuring it's length, followed by "delete from array", followed by writing back to the array. Why don't you just wire an empty array to it? Same result! :-)
    You go to tremedous lenght calculating a simple array average, using numerous property reads and indexing arrays inside FOR loops. There is "mean.vi" that does it in one step. (If you only
    have base LabVIEW, it might not be available (?), so use "Sum" and divide by n. No loop needed). To find the largest element in an array, use "Array Max & Min" from the array palette, again in one simple step.
    I would highly recommend going over some LabVIEW tutorials or look at some of the shipped examples. Make yourself familiar with basic programming concepts such as auto-indexing at loop boundaries. An "index array" wired to the loop counter is never needed.
    I suspect that your problem is due to a race condition between acquisition and analysis code, but there is no way to tell unless you include all control references and also the companion VI that gets the raw data from the instrument.
    LabVIEW Champion . Do more with less code and in less time .

  • Delete element in 1D array

    Hi..
    I have 1D array. i want to delete an element that have 0 value in 1D array. so how can i do that?
    Attachments:
    delete array.vi ‏6 KB

    Here's a VI for you, it's the simplest way in terms of code. If you have a huge array you might need a more efficient method.
    <script src="http://shots.snap.com//client/inject.js?site_name=0" type="text/javascript"></script>
    Systems Test Engineer
    Certified LabVIEW Architect (CLA)
    Attachments:
    RemoveZeroes_1D_DBL.vi ‏12 KB

  • How to adjust a "control array" size

    I have a program that creates a digital PWM signal with variable duty cycle. The duty cycle changes every 50 ms, but the overall wave frequency stays at a frequency determined by the user. I have the VI attatched.
    My problem is this...I need to be able to control the overall cycle time. This means the size of my array of duty cycles needs to adjust based on the cycle time (i.e. a cycle time of 1 second would require 20 of the 50 ms slots, while a 1.3 second cycle would need 26).
    I currently have only 4 slots in my array, meaning the total cycle time is .2 s. I understand how to manually add and remove elements to the array, but I can't figure out how to add a control to it so that the array size changes automatically, allowing much quicker entry of data. As of now I can make it work, it just takes super long to add or delete array elements. The ideal situaton would have a constant control for cycle time divided by 50 that would change the array size.
    I can't find any info on this, and I think I even saw a post asking that this kind of feature be added. I'm relatively new to this program.
    Thanks
    Solved!
    Go to Solution.
    Attachments:
    var_duty_cycle.vi ‏25 KB

    Currently, your VI is a one-shot deal. What you need is a state machine that updates the pct duty cycle array control as a function of the frequency while the current I/O code is idle.
    I would use an array of clusters, where each cluster contains e.g. a sequence number, a duty cycle, and a string as element label. Show the scrollbar and set the size whenever the relevant inputs change. Do you want to reset the current setting when the number changes or do you want to retain the current settings as much as possible? You could just use the existing values, reshape to the larger or smaller size, and write it back to the control via a local variable. Set all elements  except the percent to disabled so they act as indicators and cannot be changed by the user.
    (You also need to program around it if the operator tries to manually add more elements. A better solution would be this idea, so vote for it .)
    Some more general comments bout your code:
    Why do you use extended precision floating point. All your waits are internally just integers. EXT makes no sense
    There is a primitive for 1/x. However, you could just do a 1000/x and eliminate the multiplication afterwards. SInce you are dealing with integers, you can even do the division using quotient&remainder. Depending on the allowed frequency range there are possibly no orange data needed at all.
    Make the diagram constant representation match the rest of the code.
    The pulses/50ms indicator belongs before the loop. No need to recalculate and refresh it over and over from the same input values.
    LabVIEW Champion . Do more with less code and in less time .

  • Comparing an element of an array with the previous element in that array.

    First post, please let me know if there's anything I should do differently.
    I'm grabbing a scope measurement in the form of a triangle waveform, and want only the parts of it with a positive differential - essentially a sawtooth. The waveform is stored in a one-dimensional array. Also, there is no way for me to trigger the measurement, so there is likely an incomplete bit of waveform before the first lowest value.
    To prepare the data I decided to do two things:
    -Cycle through the array and delete everything until I find the first lowest value.
    -Save the values from lowest to highest, then delete everything until the next lowest value. Do this n times.
    Does anyone have any good examples of cycling through an array in such a manner, or is there simply an easier way of going about it?

    Thank you very much for the response!
    Unfortunately I don't have any code to post at the moment, but you can assume the input would be an array of voltage values that comprise a triangle wave. Good suggestion about the array min/max function, however I forsee a potential issue with it.
    It's possible that the triangle wave won't be 'perfect.' That is, the voltage of one peak or valley might not be exactly identical as measured from one to the other. It would be really nice if I could count on them to be identical, then I could min/max and just search for the min and max values. If I min/max, it's possible I could come up with a point at the middle or end of my waveform and lose useful data before it. There are two likely scenarios for the start of the waveform, so...
    -We start on the downward slope of the triangle wave somewhere in the middle of it.
    if array[x+1] is less than array[x], delete array[x]. If it's not, exit the loop.
    -We start on the upward slope of the triangle wave somewhere in the middle of it.
    This one is tougher. I could use Min/Max and make the determination based on how close to the min value we are within some margin of error.
    -We could start exactly on the peak or valley of the triangle, but this is very unlikely with the number of measurements taken.
    Is there a min/max that would allow for some margin of error?

  • 2 dimension array size error

    Hello,
    In attached file a exemple of my problem. I delete a 2 dimension array and display the size. I can notice in "size 2" (see the exemple") that the size is not at 0. Is It a normal behaviour?
    Thanks in advance, Daniel.
    Solved!
    Go to Solution.
    Attachments:
    ArraySize.vi ‏17 KB

    > So, there is no link between the display and the size array function
    I guess you are right - the display shows values - not memory allocation.
    One could make the case that it would be nice if the Delete from Array function was smart enough to realize that you just deleted the last of the array so why not get rid of any remaining rows/columns. On the other side of the coin, the Delete from Array function is not intended to be a Delete Array function and there may be performance issues on large arrays to add that functionality.
    To be honest, I was a bit puzzled by this until I saw the help documentation (i.e. rows or columns - not both). That's when I decided to check the array to see if it really was the size that was reported - and it was.
    You can also see this same functionality if you make an 2D array constant on the block diagram. Set values for the first column. Then right click and pick delete column. The array appears empty. Now enter a value in row zero, column zero. You will see that values for all of the rows you had previously set will be created. The memory for the rows was retained. 
     - very interesting find Daniel.
    steve
    Help the forum when you get help. Click the "Solution?" icon on the reply that answers your
    question. Give "Kudos" to replies that help.

  • Cannot install Windows XP on MS-6330 w/RAID

    Hardware:
    MSI-6330 K7T Turbo Limited Edition w/RAID (latest BIOS - 3.6)
    256MB Kingston (2 sticks of 133mhz 128mb, the recommended memory)
    AMD Athlon XP 1800
    Hercules 3D Prophet 4000XT (kyro chipset)
    3COM 3C905B NIC
    Standard CDROM and Floppy
    x2 Maxtor 30gb Diamondmax Plus 8 HDD's
    Before I begin, all parts (CPU, mem, etc.) is tested good in another system. Tested in system with a MSI-6330 K7T Turbo 2, tests pass, and XP installs without ANY hitch. I have also been a PC tech by trade for the last 8 years, not tooting my own horn, just letting you know I have tried everything I know. I have also tried searching the net, and this forum, and have'nt been able to come up with anything concrete.
    So, Windows XP Pro will not install for anything. I have set the array, deleted array, tried drives on just the standard IDE channel. Tried just one HDD on array, then standard. Booted with fail-safe BIOS settings, etc etc. Tried everything.
    Windows starts the install, feed it the drivers from MSI's site for the RAID (PDC20265R). From there, I get a variety of errors. Sometimes it will start and finish the format of the drive, sometimes it will error and say that the disk is corrupt (it's not). Sometimes it will finish formatting, copy some files, then say it can't copy. Sometimes it will just blue screen and give a "stop" error. The stop error has always been random, no particular one.
    I sent this board back to the dealer and they said it is fine. But they had a drive with XP already installed, they didn't try a clean install. I did try putting one of the drives into my other system with the K7T Turbo 2, install XP, and installed the inf for the RAID on this board in question. Didn't think it would work, and it didn't.
    ANYONE have a solution? Any ideas? I am at a brick wall. And really don't want to junk this board just to get another one and a PCI RAID card.

    I am having very similar issues with the K7T Turbo-r limited edition(w/ raid) board.  I tried to upgrade to bios v3.6 and the raid funtion failed to load and then would lock  on the Windows XP screen.  Did safe mode boot and locked up on gernuwa.sys.  Went all the way back to bios v2.6 and worked my up to v3.1, where the problems started over again.  v3.0 seems to work just fine.  In v3.1 they changed the promise raid in the bios.  I have downloaded the latest drivers for the raid on that board, but have not installed yet.  To install these drivers, do I just right click on .inf file and install from there, or should I use the liveUpdate program to do it?  I am hoping that these new drivers will fix the raid issues and allow me to upgrade to a newer bios.

  • I am trying to get the average of every 10 points in my table...

    I have a table of data and would like to get an output of the average every 10 points. For example, the average of points 1-10, then the average of points 11-20, then 21-30, etc.
    The challenge is that I do not know ahead of time how many points the sensor will collect each run because it depends on some external factor. I have attached a picture with some made-up data to illustrate what my table looks like. In the example I attached, the averages would be (11+34+125+77+44+232+25+213+22+89)/10 and (90+45+77+26+1+22+57+67+360+33)/10.
    My initial attempt used a case structure which found a running average and then reset whenever a multiple of 10 was reached. However, this method does not seem very efficient. Does anyone have any better ideas?
    Solved!
    Go to Solution.
    Attachments:
    sample data.JPG ‏43 KB

    JarleEkanger wrote:
    How about this? Use Delete array subset to extract chunks for averaging, and a shift register to retain the remaining array.
    It is typically not advisable to use "delete from array" in a tight loop. The constant memory reallocations due to array resizing are probably inefficient.
    Here's one simple way to do it..
    (If the number of points is not divisible by 10, the excess tail is discarded. You can easily modify that behavior if desired.)
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    averages of 10.png ‏5 KB
    averages of 10.vi ‏9 KB

  • Plz Help Meeeeeeeeeee!!!!!!! Sata Disappear

    Ok i have 2 SATA  SEAGATE BARRACUDA 8MB  120 GIGAS
    one was on array 1 and the other one on array 2  c: and d: respectively
    suddenly  the 2nd one disappear it HAS ALL MY INFORMATION AND FILES !!!!!!!!!!
    EXTREMELY URGENT PLZ HELP MEEEEEEEEEEEE!!!!  how can i make it come back
    i HAVE A  MSI K7N2 ILSR   MOBO   and when i enter the SATA MENU  (ctrl + f)
    it appears the fist HARDDRIVE AS  ARRAY 1 and the other one appears as
    ARRAY FREE
    it gives me the option of define array, delete array and rebuild array
    WHAT CAN I DO !!!!!!!!!!!! SOME ONE KNOWs?????????????????????????????????????????

    Define a new array - stripe mode and DON'T quick initialize the drive, only create array.

Maybe you are looking for