LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to delet 0 from multiple column in 2D array

Solved!
Go to solution

Dear sir,

 

 please tell me how delet 0 from multiple column besuace to delet zero from one by one column take too much time. here i have attache the main file and programme with this message. 

 

delet zore.jpg

Download All
0 Kudos
Message 1 of 10
(3,374 Views)

What is your goal for deleting these entries?

 

One basic info btw:

A multi-dimensional array requires all parts within each dimension to be of the of the same size.

For better understanding:

A 2D array has two dimensions, we often call ROW and COLUMN. So each row has to have the same number of columns, each column has to have the same number of rows. So a 2D array is always a "rectangle".

E.g. if column 0 has 10 elements (rows), each other column also has to have 10 elements (rows). If row 1 has 5 elements (columns), all other rows have to have 5 elements (columns) as well.

 

So:

What do you intend to replace the '0' with? You cannot simply remove that entry as it would reduce the number of rows for that column.

 

Sidequestion:

Why are there '0's if you dont like them?

 

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 2 of 10
(3,347 Views)

Also, if the data ren't really the same, why are they in an array instead of a cluster?

[edit] e.g. separate arrays within a cluster.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 3 of 10
(3,327 Views)

I assume you want to delete all rows where certain columns are all zero. Is this right?

 

(Just glancing at your code, please get rid of the matrix operations, they make no sense. Also you should not wire N if you are autoindexing. You also need to initialize your shift registers where you keep track of the position!)

0 Kudos
Message 4 of 10
(3,307 Views)
Solution
Accepted by Julian_prince

Julian_prince wrote:

please tell me how delet 0 from multiple column besuace to delet zero from one by one column take too much time. here i have attache the main file and programme with this message. 


How big are your actual arrays? How do you measure the speed? How fast is it currently and how fast does it need to be?

 

In any case, you can do it all with one loop, e.g. as attached.

 

 

Message 5 of 10
(3,303 Views)

Dear sir,

 

Thanks for reply,

 

This file has array size of 87815 to run one file it takes approximately 1-2 minute, i want make so it will take time 30 sec for one file.

 

Programme provided by you is gud and takes less time than my programme but still i need some more speed to make it fast.

0 Kudos
Message 6 of 10
(3,275 Views)

Dear,

 

 Yes i want to delet certain columns with have zero , but there are also some column in which i want to keep zero.

0 Kudos
Message 7 of 10
(3,268 Views)

Julian_prince wrote:

This file has array size of 87815 to run one file ...


What are the units? 87815 Bytes, Kilobytes, Megabyes? DBL array elements??

 

Again, how do you measure the speed? In the 5125kB file you have attached above, the code takes only 20ms on my 7 year old laptop. Reading the file is actually significantly (~50x) slower than that, so reading and parsing the file is the limiting step. Processing the array is insignificant.

 

This is one of the reasons why you should use binary files if performance is important.

 

I am sure you could go a bit faster by e.g. not converting to DBL, but operating on an array of strings, for example. I get about 2x faster. What exactly do you need at the end? Do you really need the DBL array?

0 Kudos
Message 8 of 10
(3,265 Views)

Please tell me the option to take in array of string I don't need DBL array.

0 Kudos
Message 9 of 10
(3,254 Views)

Is the pattern always very regular as in your example file (i.e. delete every other row) or are the lines to be deleted distributed randomly?

(Example files should always be typical and not contain extra assumptions!)

0 Kudos
Message 10 of 10
(3,235 Views)