05-03-2011 06:31 AM
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.
05-03-2011 06:37 AM
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'?
05-04-2011 07:24 AM
Hi Qing,
You questions seems to be more Matlab related than LabVIEW related. Have you had a look at the Matlab community page?
05-04-2011 07:32 AM
This webpage may be able to help you: http://zone.ni.com/devzone/cda/tut/p/id/7006
05-04-2011 07:33 AM
Yes I did. Matlab has small differences with Mathscript. I copyed over some examples from Matlab website. They did not work in LabVIEW Mathscrpt.
05-04-2011 09:32 AM
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.
05-04-2011 09:40 AM
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?
05-04-2011 09:42 AM
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.