annulla
Visualizzazione dei risultati per 
Cerca invece 
Intendevi dire: 

MathScript plot, how do I specify 2nd Y axis maximum and minmum?

x = 0:0.01:20;

y1 = 200*exp(-0.05*x).*sin(x);

y2 = 0.8*exp(-0.5*x).*sin(10*x);

plotyy(x,y1,x,y2);

axis([0,20,-200,200])

 

above script plot successfully a graph with require left y axis from -200 to +200.  However, how do I make the right y axis from -2 to +2?

 

Thank you in advance.

0 Kudos
Messaggio 1 di 8
3.792Visualizzazioni

x = 0:0.01:20;

y1 = 200*exp(-0.05*x).*sin(x);

y2 = 0.8*exp(-0.5*x).*sin(10*x);

plotyy(x,y1,x,y2);

axis([0,20,-200,200]);

xlabel('Time (\musec)');

ylabel('Fast decay');

title('Multiple Decay Rates');

 

How do I write the 2nd Y title to 'Slow Decay'?

0 Kudos
Messaggio 2 di 8
3.785Visualizzazioni

Hi Qing,

 

You questions seems to be more Matlab related than LabVIEW related. Have you had a look at the Matlab community page?

0 Kudos
Messaggio 3 di 8
3.760Visualizzazioni

This webpage may be able to help you: http://zone.ni.com/devzone/cda/tut/p/id/7006

0 Kudos
Messaggio 4 di 8
3.757Visualizzazioni

Yes I did.  Matlab has small differences with Mathscript.  I copyed over some examples from Matlab website.  They did not work in LabVIEW Mathscrpt.

0 Kudos
Messaggio 5 di 8
3.756Visualizzazioni

As far as I can tell, MathScript does not have the necessary functions to do what you are asking. In newer versions of LabVIEW there is the "axes" function, but I don't know if that will do what you want.

0 Kudos
Messaggio 6 di 8
3.745Visualizzazioni

Thank you for replying to me.  Mathscript let me plot a 2nd Y on the right but not let me to put a label for it.  Do you think this is a fault of LabVIEW in design?  What is the point to put a "plotyy" function there but not being able to scale it or label it?  Does National Instruments has a channel to complain?

0 Kudos
Messaggio 7 di 8
3.742Visualizzazioni

I agree that this is a limitation in MathScript. I would also agree that it makes no sense to have a plotyy function, but no function to label the second Y-Axis plot.

 

Did you take a look at the "axes" function to see if that will work? Unfortunately, I can't test it since I don't have a MathScript license for the newer versions of LabVIEW.

0 Kudos
Messaggio 8 di 8
3.739Visualizzazioni