LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Nested For Loops

Solved!
Go to solution

Hello Guys,

Am a newbie, So can any one help me to sort out this issue. 

 

This is the Sequence

Input 2D array -> indexed by 2x2 array -> find the Max and Min difference in the 2x2 array -> Result Element should be compared with input 2x2 Array each element, If its greater Replace with 1 else 0 -> At last the output array should be same as input array size.

 

Attached Vi for Reference. How to do this? Thanks in advance.

0 Kudos
Message 1 of 6
(3,482 Views)

Try something like this (LabVIEW 2011).

 

Modify as needed. Are the input array dimension always even?

Message 2 of 6
(3,472 Views)

@altenbach wrote:

Are the input array dimension always even?


Dear Altenbach

 Thanks for the reply, Yes it's always even only and one more thing the Array Max and Min Function can be replaced with Mean Function.

0 Kudos
Message 3 of 6
(3,464 Views)
Solution
Accepted by topic author Gopi_nath

The mean function does not work on 2D arrays, but you can use "add array elements" and divide by four.

 

Is the rest of my code working for you?

 

 

(EDIT: upladed new version. You need to be careful not to overflow U8 when summing.)

 

Message 4 of 6
(3,461 Views)

Yes it works..

0 Kudos
Message 5 of 6
(3,456 Views)

Summing four U8 values can easily exceed 256, so we should convert to a better representation before taking the mean. I attached a new version above. Please discard the earlier version.

0 Kudos
Message 6 of 6
(3,452 Views)