キャンセル
次の結果を表示 
次の代わりに検索 
もしかして: 

Eliminating element in an array

I would like to eliminate the element in an array . Here say I want to eliminate all the cells with "0" or "Empty" and put only elements other than "0" or Empty into an new array. Without leaving any space or Cell with emptiness. I had tried and I am having a problem. I had also created a array as expected result. 

Here with I post it. Can any one give a solution. 

 

Thank you

 

With regards

0 件の賞賛
メッセージ1/9
3,687件の閲覧回数

Hi,

 

Use the Array search function instead of String functions.

 

You can search for a particular element (zero) in the array and use the index to delete or replace with the element required.

 

I have added screen shot of the LabVIEW functions, which searches the Zero and deletes from the Array.

 

Hope this helps

0 件の賞賛
メッセージ2/9
3,669件の閲覧回数

Hai Vijay,

 

      Thank you. What do u do in False case. Can you send me as VI if possible. So that I can have look. Because I tried similar one before, but in False case still some value either as zero or as empty is getting appended in the new array. I want to know how to block sending data in False case. It would nice if you attach your solution VI so that I can run and see. I am using Labview 2012. Looking forward to hear from you. 

 

Thank you for the same.

 

With regards

0 件の賞賛
メッセージ3/9
3,660件の閲覧回数

I have added the modified VI. All the best.

0 件の賞賛
メッセージ4/9
3,645件の閲覧回数

Never use "delete from array" in a tight loop! You should adapt something like this instead.

0 件の賞賛
メッセージ5/9
3,617件の閲覧回数

@Johannes4u wrote:

I would like to eliminate the element in an array . Here say I want to eliminate all the cells with "0" or "Empty" and put only elements other than "0" or Empty into an new array. Without leaving any space or Cell with emptiness. I had tried and I am having a problem. I had also created a array as expected result. 



Your array of expected resuts contains a lot of elements with empty strings so that does not seem right! Please check your code.

 

Since you have LabVIEW 2012, you can use the conditional tunnel to do exactly what you want with very little code. Here's an example.

 

すべてをダウンロード
メッセージ6/9
3,608件の閲覧回数

And here's how you would do it without conditional tunnels. Same result. (the other case is ["", "0"] and is simply wired across).

 

 

すべてをダウンロード
メッセージ7/9
3,603件の閲覧回数

Here's a thread over on LAVA that is a good read.  We went through trying to improve the OpenG Array functions.  You'll find some interesting tricks in there.

OpenG filter array revised



There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 件の賞賛
メッセージ8/9
3,555件の閲覧回数

Thank you Mr. Altenbach.

 

With Regards

0 件の賞賛
メッセージ9/9
3,504件の閲覧回数