LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Two curves on a single plot

Solved!
Go to solution

What am I doing differently between these two files? I want to plot two curves on the same plot in the file DecayingGaussian.vi, but when doing the same thing as in 2 curves in single plot-1.vi, I get an error. I'm at a loss.

Download All
0 Kudos
Message 1 of 4
(2,609 Views)
Solution
Accepted by topic author jnc8mc

Modify decaying Gaussian like below.

  1. Make your points index on the for loop.
  2. Then bundle the arrays (x, y array)
  3. Then put the clusters into an array.

mcduff

 

Snap44.png

Message 2 of 4
(2,596 Views)

Your x-values are equally spaced (x0=0, dx=1), so a simple waveform graph is sufficient.

 

Also:

  • There is a primitive for e^x and 10^x,
  • The /250 exist is both case and thus belongs before the case structure. In fact, arranged right, the two cases only differ by two diagram constants and can be pulled out of the loops.
  • I am sure there is a way to have fewer coercion dots.

 

0 Kudos
Message 3 of 4
(2,562 Views)

Also note that you are doing a lot of duplicate operations. For example the Gaussian only needs to be calculated once before the loop and not 500 times in a row. The outer FOR loop only applies scaling.

 

There are plenty of ways to rewrite that code more efficiently, here is one possibility.

 

GaussianDecay.png

0 Kudos
Message 4 of 4
(2,558 Views)