LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Replace Array elements - Please help..

Hi,

I have been working couple of days to find teh solution and simply gave
up 🙂 Please try to help !!!

Input:
1D array as input (reprsenting amplitues in my case).
Cycle - Numeric
Window Size - Numeric

I need to flat the amplitude in a specific index for a specific window,
i.e. assign zero values to specific elements within the array.

Example:
1D array: 1 2 3 4 5 6 7 8 9 10
Cycle: 4 (Assign zero value in every 4th elements
Window Size: 1 (Assign One zero before the Cycle and one zero after the
cycle)

Desired Output:
1 2 0 0 0 6 0 0 0 10


THANKS!!

0 Kudos
Message 1 of 4
(2,768 Views)

Hi Molder,

If i understand you well, the following VI should match your purpose. Note that other solutions exist.

Regards,

0 Kudos
Message 2 of 4
(2,763 Views)
Hi Mathieu,

It works perfectly

Many Thanks for teh quick & professional response ! Molder

0 Kudos
Message 3 of 4
(2,750 Views)
I would just create a zero-filled array of size [2*Window+1] and replace each location in one swoop. Here is one possibility.
 
 
You seems to count elements starting with "1" as the first element. Real labview programmers start counting at zero! 😉 It would make the code a bit simpler.
 
(You might still need to adjust for "edge effects" because it is not clear how you want to handle cases at the ends of the array, e.g. if the center of the window is already outside, but the "edge" of the window still hits an existing element. For example, in your case it would make equal sense to zero the first element in the array.)

Message Edited by altenbach on 01-20-2007 01:42 PM

Download All
0 Kudos
Message 4 of 4
(2,739 Views)