LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

delete zero value at 2d array


@frhnnmhd wrote:

I also want to make this data like this sir, data that has a value other than zero will remain in the column and row, I just want to remove the no value. my data will remain as much as the number of rows but will change in column values because of the omission of zero values


This is still not very clear.

Do you want the number of rows to be constant or the number of columns to be constant? Why don't you show an example input and example output for illustration.

 

For example, if the 2D input array is:

 

1 2 0 3

0 0 0 0

4 5 0 6

7 0 0 8

 

What is the desired result???

 

My current code removes rows that are all zeroes. If you instead want to remove the columns that are all zeros, use the same code, but transpose the 2D array before and after the loop.

0 Kudos
Message 11 of 19
(1,227 Views)

like this i want sir
For example, this input 2D array data :

frhnnmhd_0-1664550088270.png

then i want to remove 0 value using labview

frhnnmhd_1-1664550267577.png

this is the data I want, so how can VI delete it?

 

0 Kudos
Message 12 of 19
(1,200 Views)

What will be the result after removing the zeros from this?

LLindenbauer_0-1664550801701.png

 

0 Kudos
Message 13 of 19
(1,193 Views)

I will use the data to be used as a parameter with previously being processed using machine learning

0 Kudos
Message 14 of 19
(1,185 Views)

Either whole rows/columns are deleted, or a new appended 1D array has to be created. Otherwise it makes no sense to remove single zeroes and keep the 2D array, since it would change the dimensions, which would result in zeroes either way at a different index.

0 Kudos
Message 15 of 19
(1,184 Views)

OK, it seem you want to iterate over all columns, remove all zeroes treating each column as 1D array, and reassemble it into a 2D array with all the shorter columns. What should happen if some columns have more zeroes than others? All columns in a 2D array need to have the same length!

 

You would get significantly more help if you would attach a simpler VI containing you data example as a diagram constant. Nobody want to copy things manually.

0 Kudos
Message 16 of 19
(1,174 Views)

@altenbach wrote:

OK, it seem you want to iterate over all columns, remove all zeroes treating each column as 1D array, and reassemble it into a 2D array with all the shorter columns. What should happen if some columns have more zeroes than others? All columns in a 2D array need to have the same length!


This will do it. Shorter columns will be padded with zeroes (e.g. the middle column here).

 

altenbach_0-1664552317060.png

 

0 Kudos
Message 17 of 19
(1,163 Views)

ok sir, thank you the answer is correct later there will be a change in the array in the 2d array, and it doesn't matter later the difference in the array will be closed with a value of 0 in the array that is lacking.
thank you so much

 

0 Kudos
Message 18 of 19
(1,117 Views)

I think this is the VI that is very close to my request, I will try this VI, allow me later to ask again if there are errors or things that make me confused.
thank you very much sir. I hope the best for you always

0 Kudos
Message 19 of 19
(1,116 Views)