06-25-2009 01:27 PM
Solved! Go to Solution.
06-26-2009 02:23 PM
In the Mathematics >> Numeric >> Complex palette there are conversion functions to convert to any other complex type. Then you can use other functions that work with complex data in those types.
07-02-2009 11:06 AM
07-02-2009 12:32 PM - edited 07-02-2009 12:33 PM
Is the array always the same size?
Easiest would be to create a "mask' array that is "1" in inside the circular area, and "0" outside. Now just multiply the mask with your array and then use "add array elements" on this result and on the mask array. divide the two numbers to get the average. No loops needed.
can you attach a VI containing some typical data?
07-02-2009 02:49 PM
Perhaps you should first take a square subarray (with the size of your circular region of interest) from your 2-D Array and than proceed with your profs idea or with Altenbachs idea. This could save some computing time by avoiding unnecessary comparisons or multiplications.
Jörn
07-02-2009 03:09 PM
http://forums.ni.com/ni/board/message?board.id=170&message.id=384632&query.id=227790#M384632
The solution I came up with is discussed near the bottom of the page.
07-02-2009 05:54 PM - edited 07-02-2009 05:55 PM
Here's a quick example of what I had in mind (LabVIEW 8.5).
You can move the circle with the cursor and change the radius. See if it makes sense. 😉
(It's pretty crude, but shows the main idea. Many improvements are possible)
07-02-2009 07:02 PM
this should do it
07-02-2009 11:12 PM - edited 07-02-2009 11:14 PM
Jeff, I think two loops are enough. 🙂
We also should accumulate the sum in a scalar, e.g. as follows, no need to built an array:
It's less pretty compared to my previous post, because we are flying blind, but operated pretty much "in place". This is good for a "code only" solution, where we don't need visual feedback.
Or we could only graph the "counted" points as follows:
07-02-2009 11:19 PM
altenbach wrote:Or we could only graph the "counted" points as follows:
Seems we can only attach 3 items. Here's the code for the last option (LabVIEW 8.5.1).