From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
04-24-2020 02:47 PM
I have a 2D array of data where the borders on the data are NaN or (0), could be either but not both, this data is going to an intensity plot. Is it possible to auto fit the window of the intensity graph to the data that contains values? I don't know of or can't find a property node element to do this.
Solved! Go to Solution.
04-24-2020 03:41 PM - edited 04-24-2020 03:44 PM
Take the proper array subset and graph only that. (and possibly reset x0, y0 of the axes)
-or-
Change the x-and y axes to not auto-scale and set the limits corresponding to the data.
(Note that NaN and 0 ARE values too, of course.)
04-27-2020 07:27 AM
I like the first option, the issue i'm having is searching for the rows and columns for values vs NaN or zero. If I bring each 1D array in with a while loop i can sum the values, if the sum = (0) then i can delete it, thus the zero values work better that NaN. Unfortunately this works if the values i want to delete are at the beginning of the 2D array, once they are deleted the array size is changed and i lose the order.
I'm assuming that i'll have to process the master array in terms of columns and then row to reshape it, can you help me figure out the correct way to catch and delete the blank rows/columns at the end of the row/column arrays?
04-27-2020 07:34 AM - edited 04-27-2020 07:35 AM
04-27-2020 07:47 AM
Great this worked like a champ. Conditional tunnel huh...never used it. Thank you very much.
04-27-2020 08:54 AM - edited 04-27-2020 08:55 AM
Here is the "NaN" version in case anyone needs to know, use the Not a Number/Path/Refnum found in the Comparison Menu. Thanks again.
04-27-2020 09:20 AM
Hi coolhand,
simple boolean algebra: NOT(x) AND NOT(y) == NOT(x OR Y).
Instead of negating the whole boolean array (after IsNaN?) you could negate the scalar boolean after ORArray.
(It's been a little bit "too picky", but I had to learn a whole bunch of boolean algebra in apprenticeship. I also don't like to use comparison functions on booleans when you can use plain AND/OR/XOR/... operations.)
(Maybe in the future the conditional tunnel also supports negating its condition input, so you would not even need this explicit NOT function…)