ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

deleting array element

Solved!
Go to solution
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!!!
Message 1 of 18
(4,717 Views)
Hi muks,
use a for loop and build a new array.
 
 
Mike


Message Edited by MikeS81 on 06-18-2008 01:43 PM
Message 2 of 18
(4,713 Views)
i need to handle 1500000 data. Some way to optimize it?
Message 3 of 18
(4,709 Views)

Hi muks,

ok, but to delete from an array in a loop is not the best alternative. How many entries do you want to remove?

Mike



Message Edited by MikeS81 on 06-18-2008 01:51 PM
Message 4 of 18
(4,707 Views)
I need to remove all the entries having 255 as its value no matter how many times it occurs.
Message 5 of 18
(4,700 Views)

Hi muks,

is 255 the highest value in your array? Do you need your array sorted?

Mike

Message 6 of 18
(4,697 Views)

Hi muks,

see the attached example to see the difference between delete from array and the other method.

Mike



Message Edited by MikeS81 on 06-18-2008 02:07 PM
Message 7 of 18
(4,693 Views)

Hi,

   First of all thanx a lot for your effort.May be i didnt convey what i want properly.The value in my array is going to change randomly.I want to remove the index containing the 255 value alone.I have tried doing that.Please have a look.

Message 8 of 18
(4,686 Views)

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

Download All
Message 9 of 18
(4,680 Views)
Thanx a ton mike.Also can you tell me if i want to remove values from 255 to 200 how i can go abt that.Also do u mean to say we cannot do the same thing directly using numeric functions.I would have got stuck trying this without u suggesting the string functions.
 
Thanx a lot mike
 
 
Message 10 of 18
(4,670 Views)