LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 
Reply

Two curves on a single plot

Solved!
Go to solution
Highlighted

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.

0 Kudos
Message 1 of 4
(121 Views)
Solution
Accepted by topic author jnc8mc
04-13-2019 03:18 PM

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
(108 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.

 


LabVIEW Champion Do more with less code and in less time
0 Kudos
Message 3 of 4
(74 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


LabVIEW Champion Do more with less code and in less time
0 Kudos
Message 4 of 4
(70 Views)