 paul_a_cardinal
		
			paul_a_cardinal04-05-2024 05:00 PM
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).
 avogadro5
		
			avogadro5
		
		
		
		
		
		
		
		
	
			04-05-2024 06:11 PM
so remove consecutive repeats? does "not ugly" mean no for loop?
 raphschru
		
			raphschru
		
		
		
		
		
		
		
		
	
			04-05-2024 06:24 PM
04-05-2024 08:40 PM
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
04-06-2024 06:51 AM
Here's what I ended up with:
 altenbach
		
			altenbach
		
		
		 
		
		
		
		
		
	
			04-06-2024 10:40 AM - edited 04-06-2024 01:08 PM
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.
04-06-2024 02:48 PM
Here. The inputs have their default values set to real data.