philark
2008-08-12 21:40:20 UTC
Hey All,
I've got a question that seems pretty easy in concept but for some reason I just can't quite figure it out. All I want to do is run through a matrix using for loops and if a value in that matrix is equal to the value I set (my cutoff value), I take the coordinates (the iterations of the loops) and pop them into an array, which I hope to use as a set of graphable points. So I start out by building a 2x1 1D array from the two points I get (my loop iterations again, which would represent my X and Y values), by using the Build Array VI. Now I try feeding that into another Build Array VI that has a feedback loop on it which feeds back into itself. The output from this is then sent to an Array Size VI (which is outside the loops) so that I can see just how big my 2xN array got.
Now the good news is that I do get a 2D array as an output. The bad news is that try to get the data exactly when my cut off point occurs (ie. if(data == cutoff) ) I get no size, but if I created a range of even one lower (ie. if( (data <= cutoff) || (data >= (cutoff-1))) ) then the size of my array turn out to be 2x49152, which is the total range of my data (192*256). Now I know for a fact that not every point in my data is one less than my cutoff point (which is the maximum value in this case) as I have a meshing that shows me the values. I also thought that maybe conflicting data types might be a problem, so I converted my cutoff value from a int to a float type. No dice there either. Soooo, I figure it must be some underlying logic that I'm missing or something that LabView does differently than I expect.
I guess my actual question is this then: Why does LabView gives me either a 0 element array or a complete array (as in ALL the data points not just the ones at the cutoff value)? Also if there is a better way to build the array than this.
I have attached a picture of my current set up that retrieves the data points, builds the 2xN array and gets the size. If there's any other part that you may need to see, just let me know.
Thanks,
Phil
[url=Loading Image...][/url]P.S. Here's an direct link to the image if the above doesn't work: Loading Image...
I've got a question that seems pretty easy in concept but for some reason I just can't quite figure it out. All I want to do is run through a matrix using for loops and if a value in that matrix is equal to the value I set (my cutoff value), I take the coordinates (the iterations of the loops) and pop them into an array, which I hope to use as a set of graphable points. So I start out by building a 2x1 1D array from the two points I get (my loop iterations again, which would represent my X and Y values), by using the Build Array VI. Now I try feeding that into another Build Array VI that has a feedback loop on it which feeds back into itself. The output from this is then sent to an Array Size VI (which is outside the loops) so that I can see just how big my 2xN array got.
Now the good news is that I do get a 2D array as an output. The bad news is that try to get the data exactly when my cut off point occurs (ie. if(data == cutoff) ) I get no size, but if I created a range of even one lower (ie. if( (data <= cutoff) || (data >= (cutoff-1))) ) then the size of my array turn out to be 2x49152, which is the total range of my data (192*256). Now I know for a fact that not every point in my data is one less than my cutoff point (which is the maximum value in this case) as I have a meshing that shows me the values. I also thought that maybe conflicting data types might be a problem, so I converted my cutoff value from a int to a float type. No dice there either. Soooo, I figure it must be some underlying logic that I'm missing or something that LabView does differently than I expect.
I guess my actual question is this then: Why does LabView gives me either a 0 element array or a complete array (as in ALL the data points not just the ones at the cutoff value)? Also if there is a better way to build the array than this.
I have attached a picture of my current set up that retrieves the data points, builds the 2xN array and gets the size. If there's any other part that you may need to see, just let me know.
Thanks,
Phil
[url=Loading Image...][/url]P.S. Here's an direct link to the image if the above doesn't work: Loading Image...