10-31-2018 03:04 PM
Looking to do some data analysis on a dataset i'm capturing and got jammed up on the first step.
I have a 2D array of (Z) height data where (X = rows) and (Y = Columns). I actually get data for (1800) rows by (400) columns, the total array size is (7107 x 400), everything from row (1800) to (7107) is ZEROES. I'd like to delete the ZEROES. i tried delete from array and subset array VI's but i can't figure them out. They don't do what i think they should do, i don't understand. What i did learn is that delete means turn data into ZEROES, in other words the array size is not changed i can manipulate the data but really need to just change the size.
Anyway are there examples on how to do this?
10-31-2018 03:08 PM
Hi coolhand,
what have you tried?
And why don't you use ArraySubset to get the first 1800 rows?
What i did learn is that delete means turn data into ZEROES, in other words the array size is not changed i can manipulate the data but really need to just change the size.
Which is completely wrong!
DeleteFromArray will remove rows or columns from a 2D array…
Anyway are there examples on how to do this?
10-31-2018 03:43 PM
As Gerd said, you are doing something completely wrong. However, we cannot tell unless you attach some simplified code that shows the problem you are seeing.
To do exactly what you want, you can use e.g.:
("delete from array" is probably least preferred, because you have no use for the deleted portion, so why use a primitive that creates it. Not sure if the compiler eliminates that part of the code if the output is not connected)
11-01-2018 06:46 AM
@altenbach wrote:
("delete from array" is probably least preferred, because you have no use for the deleted portion, so why use a primitive that creates it. Not sure if the compiler eliminates that part of the code if the output is not connected)
Yes, that portion is "stomped" now. I can dig a little to find what version, but it was a while ago.
11-01-2018 07:51 AM
@crossrulz wrote:
@altenbach wrote:
("delete from array" is probably least preferred, because you have no use for the deleted portion, so why use a primitive that creates it. Not sure if the compiler eliminates that part of the code if the output is not connected)
Yes, that portion is "stomped" now. I can dig a little to find what version, but it was a while ago.
Ok, found the thread over on LAVA: https://lavag.org/topic/16226-new-array-vi/?do=findComment&comment=109035
Delete From Array, as of LabVIEW 2014, is the most efficient way to get the last element of an array (don't wire the Index input).
11-01-2018 12:23 PM - edited 11-01-2018 12:23 PM
@crossrulz wrote:
@crossrulzDelete From Array, as of LabVIEW 2014, is the most efficient way to get the last element of an array (don't wire the Index input).
Deleting the last element (or row, etc.) is not the same as deleting a random subset. It is not clear if one trivial optimization (only the array connected) lets us conclude that the other more general functionality (position and size connected) also optimizes for disconnected outputs. (A casual glance at your linked thread does not tell, but maybe I need to read more carefully... ;))
11-01-2018 02:56 PM
The Array needed to be transposed, as soon as i transposed it the dimension changed as intended. Not sure why i was getting all of the (0) fill in the data though that was weird.
11-01-2018 03:01 PM
Could it be that these were not actual zeroes, but just unused elements because the array container was resized larger than the array size? (Unused elements are typically shown as grayed zeroes, or whatever the default value for the element is.)