LabVIEW Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
0 Kudos
X.

new Ramp Pattern "single point" behavior

Status: Declined

Any idea that has not received any kudos within a year after posting will be automatically declined. 

In the series "Intended versus expected" (or blue versus orange), this is a discussion of a not very helpful feature of the Ramp Pattern VI:

 

ScreenHunter_001.jpg

 

If you ask for a single sample (samples = 1) from the Ramp Pattern AND do not set "exclude end?" to True, the VI returns an error -20006: "Analysis:  The number of samples must be >= 2."

The Help specifies that: " If samples is 1 and exclude end? is TRUE, the VI returns an array with one element of start."

It doesn't say anything about the situation I described previously, but most likely the error comes from the likely following definitions of the array {xi} of values (in the linear case):

 

1) exclude end? xi = xs + i*(xe-xs)/N, where i = 0,..., N-1 and (xs, xe) are the start and end points respectively

2) do not exclude end: xi = xs + i*(xe-xs)/(N-1).

 

In the second case, N = 1 results in a division by zero, hence an error.

 

So far so good, but here is the catch: Suppose I want to build a curve with equidistant abscissa (number N), comprised between a start and end points xs and xe (both included). It seems like the Ramp Pattern has been designed for me, right?

 

Wrong. If I set xs = xe and N = 1, I would expect a single point, equal to xs = xe. Instead, I get an error. So my first contention is that this should be a detected case: xe = xs AND N = 1, should result in a single element array equal to xe = xs.

 

Now, what I would suggest is that if xs != xe AND N = 1, then the Ramp Pattern could return a single element equal to (xs + xe)/2 (and a similar definition for a logarithmic ramp).

1 Comment
Darren
Proven Zealot
Status changed to: Declined

Any idea that has not received any kudos within a year after posting will be automatically declined.