LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Need to Filter Data

I have a loop that generates pairs of coordinates (X, Z) that are waypoints.

Eventually, a path is linearly interpolated between the waypoints.

Because of the nature of the data, there will be long sequences where Z doesn't change.  Within those sequences, I want to keep only the endpoints, deleting the superfluous waypoints in between.

Any suggestions on how to approach this would be appreciated (so far, my attempts are ugly).

zf.png

0 Kudos
Message 1 of 7
(599 Views)

so remove consecutive repeats? does "not ugly" mean no for loop?

avogadro5_0-1712358574241.png

 

0 Kudos
Message 2 of 7
(578 Views)

Hi Paul,

 

Here is how I would proceed. Also, I assumed only the Zs need to be filtered, as the X is constant during the current iteration of the main loop.

 

raphschru_1-1712359078668.png

 

Regards,

Raphaël.

0 Kudos
Message 3 of 7
(572 Views)

Neither will work because I need both endpoints of the sequence.  For instance, if I start with:

x=1, z=0.1

x=2, z=0.1

x=3, z=0.1

x=4, z=0.1

x=5, z=0.2

I want to end up with:

x=1, z=0.1

x=4, z=0.1

x=5, z=0.2

0 Kudos
Message 4 of 7
(551 Views)

Here's what I ended up with:

paul_a_cardinale_0-1712404235454.png

 

0 Kudos
Message 5 of 7
(468 Views)

Still seems overly complicated. Could you please attach your actual VI (2020 or below) and some typical data? thanks.

 

See if this can give you some ideas (probably still need some tweaks, e.g. remove duplicates)

 

EDIT: slightly improved version.

 

altenbach_0-1712421730083.png

 

0 Kudos
Message 6 of 7
(449 Views)

Here.  The inputs have their default values set to real data.

Download All
0 Kudos
Message 7 of 7
(423 Views)