ENGR-25_Plot_Model-4.ppt 1 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Bruce Mayer, PE Registered Electrical.

Slides:



Advertisements
Similar presentations
Empirical Model Building I: Objectives: By the end of this class you should be able to: find the equation of the “best fit” line for a linear model explain.
Advertisements

Class 7.2: Graphical Analysis and Excel Solving Problems Using Graphical Analysis.
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 ~ Curve Fitting ~ Least Squares Regression Chapter.
ENGR-25_Lec-29_MS_Excel-2.ppt 1 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Bruce Mayer, PE Licensed Electrical.
MTH55_Lec-53_Fa08_sec_8-4_Eqns_Quadratic_in_Form.ppt 1 Bruce Mayer, PE Chabot College Mathematics Bruce Mayer, PE Licensed Electrical.
MTH15_Lec-19_sec_4-2_Logarithmic_Fcns.pptx 1 Bruce Mayer, PE Chabot College Mathematics Bruce Mayer, PE Licensed Electrical &
P M V Subbarao Professor Mechanical Engineering Department
EGR 105 Foundations of Engineering I
Excel Part III Curve-Fitting, Regression Section 8 Fall 2013 EGR 105 Foundations of Engineering I.
EGR 105 Foundations of Engineering I Fall 2007 – week 7 Excel part 3 - regression.
Part 4 Chapter 13 Linear Regression
EGR 105 Foundations of Engineering I Fall 2007 – week 7 Excel part 3 - regression.
Probability & Statistics for Engineers & Scientists, by Walpole, Myers, Myers & Ye ~ Chapter 11 Notes Class notes for ISE 201 San Jose State University.
Chapter 5 Plotting Data Curve Fitting, Good Graphing Practices Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
MTH55_Lec-63_sec_9-4b_Log_Change_Base.ppt 1 Bruce Mayer, PE Chabot College Mathematics Bruce Mayer, PE Licensed Electrical & Mechanical.
Calibration & Curve Fitting
Physics 114: Lecture 17 Least Squares Fit to Polynomial
Exponentials, logarithms and rescaling of data Math 151 Based upon previous notes by Scott Duke- Sylvester as an adjunct to the Lecture notes posted on.
9 - 1 Intrinsically Linear Regression Chapter Introduction In Chapter 7 we discussed some deviations from the assumptions of the regression model.
MTH55_Lec-07_sec_2-3a_Lines_by_Intercepts.ppt 1 Bruce Mayer, PE Chabot College Mathematics Bruce Mayer, PE Licensed Electrical.
ENGR-25_Arrays-2.ppt 1 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Bruce Mayer, PE Licensed Electrical.
MTH15_Lec-02_Fa13_sec_1-2_Fcn_Graphs.pptx 1 Bruce Mayer, PE Chabot College Mathematics Bruce Mayer, PE Licensed Electrical & Mechanical.
ENGR-25_MATLAB_OverView-1.ppt 1 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Bruce Mayer, PE Licensed Electrical.
Licensed Electrical & Mechanical Engineer
Empirical Model Building Ib: Objectives: By the end of this class you should be able to: Determine the coefficients for any of the basic two parameter.
ENGR-25_Linear_Equations-1.ppt 1 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Engr/Math/Physics 25 Chp8.
Licensed Electrical & Mechanical Engineer
Introduction to MATLAB for Engineers, Third Edition Chapter 6 Model Building and Regression PowerPoint to accompany Copyright © The McGraw-Hill Companies,
ENGR-43_Lec-06a_Fourier_XferFcn.pptx 1 Bruce Mayer, PE Engineering-43: Engineering Circuit Analysis Bruce Mayer, PE Licensed Electrical.
MTH16_Lec-01_sec_6-1_Integration_by_Parts.pptx 1 Bruce Mayer, PE Chabot College Mathematics Bruce Mayer, PE Licensed Electrical.
MTH55_Lec-51_sec_8-3a_Quadratic_Fcn_Graphs.ppt 1 Bruce Mayer, PE Chabot College Mathematics Bruce Mayer, PE Licensed Electrical.
MTH55_Lec-09_sec_2-4_Pt-Slp_Line-Eqn.ppt 1 Bruce Mayer, PE Chabot College Mathematics Bruce Mayer, PE Licensed Electrical & Mechanical.
Bivariate Data When two variables are measured on a single experimental unit, the resulting data are called bivariate data. You can describe each variable.
Applications The General Linear Model. Transformations.
ENGR-36_Lec-22_Wedge-n-Belt_Friction.pptx 1 Bruce Mayer, PE Engineering-36: Engineering Mechanics - Statics Bruce Mayer, PE Licensed.
MTH55_Lec-10_sec_3-1_2Var_LinSys_ppt 1 Bruce Mayer, PE Chabot College Mathematics Bruce Mayer, PE Licensed Electrical & Mechanical.
MTH55_Lec-46_sec_7-6b_2Var_Radical_Eqns.ppt 1 Bruce Mayer, PE Chabot College Mathematics Bruce Mayer, PE Licensed Electrical &
MECN 3500 Inter - Bayamon Lecture 9 Numerical Methods for Engineering MECN 3500 Professor: Dr. Omar E. Meza Castillo
ENGR-25_MATLAB_OverView-1.ppt 1 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Bruce Mayer, PE Licensed Electrical.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Introduction to MATLAB 7 for Engineers Chapter 5B Model.
ES 240: Scientific and Engineering Computation. Chapter 13: Linear Regression 13. 1: Statistical Review Uchechukwu Ofoegbu Temple University.
ENGR-25_Programming-3.ppt 1 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Bruce Mayer, PE Licensed Electrical.
MTH55_Lec-65_Fa08_sec_9-5b_Logarithmic_Eqns.ppt 1 Bruce Mayer, PE Chabot College Mathematics Bruce Mayer, PE Licensed Electrical.
Lecture 10 2D plotting & curve fitting Subplots Other 2-D Plots Other 2-D Plots Curve fitting © 2007 Daniel Valentine. All rights reserved. Published by.
MTH15_Lec-20_sec_4-3_EXP-n-LOG_Derivatives.pptx 1 Bruce Mayer, PE Chabot College Mathematics Bruce Mayer, PE Licensed Electrical.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Introduction to MATLAB 7 for Engineers Chapter 5B Model.
MTH55_Lec-26_sec_5-7_PolyNom_Eqns-n-Apps.ppt 1 Bruce Mayer, PE Chabot College Mathematics Bruce Mayer, PE Licensed Electrical.
MTH55_Lec-61_sec_9-3b_Com-n-Nat_Logs.ppt 1 Bruce Mayer, PE Chabot College Mathematics Bruce Mayer, PE Licensed Electrical & Mechanical.
MTH55A_Lec-05_sec_2-2_Fcn_Graphs.ppt 1 Bruce Mayer, PE Chabot College Mathematics Bruce Mayer, PE Licensed Electrical & Mechanical.
Scientific Computing General Least Squares. Polynomial Least Squares Polynomial Least Squares: We assume that the class of functions is the class of all.
Graphical Analysis in Excel EGN 1006 – Introduction to Engineering.
11/20/2015ENGR 111A - Fall MatLab – Palm Chapter 5 Curve Fitting Class 14.1 Palm Chapter:
ENGR-25_Plot_Model-4.ppt 1 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Bruce Mayer, PE Registered Electrical.
ENGR-25_Programming-4.ppt 1 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods 1 Bruce Mayer, PE Licensed Electrical.
ENGR-25_Lec-27_MuPAD_Miscellaneous-n-TYUs.pptx 1 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Bruce Mayer,
Polynomials, Curve Fitting and Interpolation. In this chapter will study Polynomials – functions of a special form that arise often in science and engineering.
ENGR-45_Lec-07_Diffusion_Fick-2.ppt 1 Bruce Mayer, PE Engineering-45: Materials of Engineering Bruce Mayer, PE Registered Electrical.
ENGR-44_Lec-06-2_Inductors.ppt 1 Bruce Mayer, PE Engineering-43: Engineering Circuit Analysis Bruce Mayer, PE Licensed Electrical.
ENGR-25_Lec-21_Integ_Diff.ppt 1 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Bruce Mayer, PE Licensed Electrical.
ENGR-25_Programming-1.ppt 1 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Bruce Mayer, PE Registered Electrical.
1 Lecture 8 Post-Graduate Students Advanced Programming (Introduction to MATLAB) Code: ENG 505 Dr. Basheer M. Nasef Computers & Systems Dept.
MTH55_Lec-51_sec_8-3a_Quadratic_Fcn_Graphs.ppt 1 Bruce Mayer, PE Chabot College Mathematics Bruce Mayer, PE Licensed Electrical.
ENGR-25_HW-01_Solution.ppt 1 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Bruce Mayer, PE Licensed Electrical.
Lecture 10 2D plotting & curve fitting
§5.7 PolyNomial Eqns & Apps
MatLab – Palm Chapter 5 Curve Fitting
Registered Electrical & Mechanical Engineer
Licensed Electrical & Mechanical Engineer
Multivariate Analysis Regression
Presentation transcript:

ENGR-25_Plot_Model-4.ppt 1 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Bruce Mayer, PE Registered Electrical & Mechanical Engineer Engr/Math/Physics 25 Chp6 MATLAB Fcn Discovery

ENGR-25_Plot_Model-4.ppt 2 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Learning Goals  Create “Linear-Transform” Math Models for measured Physical Data Linear Function → No Xform Power Function → Log-Log Xform Exponential Function → SemiLog Xform  Build Math Models for Physical Data using “n th ” Degree Polynomials  Use MATLAB’s “Basic Fitting” Utility to find Math models for Plotted Data

ENGR-25_Plot_Model-4.ppt 3 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Learning Goals  Use Regression Analysis as quantified by the “Least Squares” Method Calculate –Sum-of-Squared Errors (SSE or J)  The Squared Errors are Called “Residuals” –“Best Fit” Coefficients –Sum-of-Squares About the Mean (SSM or S) –Coefficient of Determination (r 2 ) Scale Data if Needed –Creates more meaningful spacing

ENGR-25_Plot_Model-4.ppt 4 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Learning Goals cont  Build Math Models for Physical Data using “n th ” Degree Polynomials  Use MATLAB’s “Basic Fitting” Utility to find Math models for Plotted Data  Use MATLAB to Produce 3-Dimensional Plots, including Surface Plots Contour Plots

ENGR-25_Plot_Model-4.ppt 5 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Function Discovery  Physical Processes for some Response (OutPut), y, as Resulting from some Excitation (InPut), x, can many times be approximated by 3 Functions 1.The LINEAR function: y = mx + b –Produces a straight line with SLOPE a of m and an INTERCEPT of b when plotted on rectilinear axes 2.The POWER function: y = bx m –gives a straight line when plotted on log-log axes 3.The exponential function y = b·10 mx or y = b·e mx –Yields a straight line when plotted on a semilog plot with logarithmic y-axis

ENGR-25_Plot_Model-4.ppt 6 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Linear Transformations  For a Linear Function We can Easily Find the Slope, m, and y-Intercept, b  Transform the Power Function to Line-Like Form  Take ln of both sides

ENGR-25_Plot_Model-4.ppt 7 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Power Function Xform  Thus the Power Function Takes the Form:  Yields a Staight Line  So if we suspect a PwrFcn, Plot the Data in Log-Log Form  Example:  If The Data Follows the Power Function Then a Plot of

ENGR-25_Plot_Model-4.ppt 8 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Power Function y = 13x 1.73  Rectlinear Plot  Log-Log Plot

ENGR-25_Plot_Model-4.ppt 9 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods y = 13x 1.73 by MATLAB loglog >> x = linspace(7, 91, 500); >> y = 13*x.^1.73; >> loglog(x,y), xlabel('x'), ylabel('y'), title('y = 13x^1^.^7^3'), grid

ENGR-25_Plot_Model-4.ppt 10 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Exponential Function Xform  Recall the General form of the Exponential Fcn  In This Case Let  Then the Xformed Exponential Fcn  Again taking the ln  A SemiLog (log-y) plot Should Show as a Straight Line

ENGR-25_Plot_Model-4.ppt 11 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Exponential Fcn Plot  Plot  Rectlinear Plot  SemiLog Plot

ENGR-25_Plot_Model-4.ppt 12 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods V = 115e -0.61t by MATLAB semilogy >> t = linspace(0, 10, 500); >> v = 115*exp(- 0.61*t); semilogy(t,v), xlabel('t'), ylabel('v'), title('v = 115e^- ^0^.^6^1^t'), grid

ENGR-25_Plot_Model-4.ppt 13 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Steps for Function Discovery 1.Examine the data near the origin. The linear function can pass through the origin only if b = 0 The exponential function (y = be mx ) can never pass through the origin –as e t > 0 (positive) for ALL t; e.g., e −2.7 = –unless of course b = 0, which is a trivial case: y = 0·e mx The power function (y = bx m ) can pass through the origin (e.g.; y = 7x 3 ) but only if m > 0 (positive) as –As y = bx -m = b/x m → Hyperbolic for negative m

ENGR-25_Plot_Model-4.ppt 14 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods “Discoverable” Functions  In most applications x is NONnegative

ENGR-25_Plot_Model-4.ppt 15 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Steps for Function Discovery 2.Plot the data using rectilinear scales. If it forms a straight line, then it can be represented by the linear function and you are finished. Otherwise, if you have data at x = 0, then a.If y(0) = 0, then try the power function. b.If y(0)  0, then try the exponential function c.If data is not given for x = 0, then proceed to step 3.

ENGR-25_Plot_Model-4.ppt 16 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Steps for Function Discovery 3.If you suspect a power function, then plot the data using log-log scales. Only a power function will form a straight line on a log-log plot. 4.If you suspect an exponential function, then plot the data using the SemiLogy scale. Only an exponential function will form a straight line on a SemiLog plot.

ENGR-25_Plot_Model-4.ppt 17 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods SemiLog and LogLog Scales Note Change in power Function x-axis scales –In this case x MUST be POSITIVE

ENGR-25_Plot_Model-4.ppt 18 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Steps for Function Discovery 5.In function discovery applications, use the log-log and semilog plots only to identify the function type, but not to find the coefficients b and m. The reason is that it is difficult to interpolate on log scales To Determine Quantities for m & b Perform the Appropriate Linearization Transform to plot one of –ln(y) vs. ln(x) → Power Fcn –ln(y) vs x → Exponential Fcn

ENGR-25_Plot_Model-4.ppt 19 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods The polyfit Function  The Command → p = polyfit(x,y,n) This Function Fits a polynomial of degree n to data described by the vectors x and y, where x is the independent variable. polyfit Returns a row vector p of length n + 1 that contains the polynomial coefficients in order of descending powers  Note That a FIRST Degree Polynomial Describes the Eqn of a LINE If w =p 1 z +p 2 then polyfit on data Vectors W & Z returns: p = ployfit(Z,W,1) = [p 1, p 2 ] → [m, b]

ENGR-25_Plot_Model-4.ppt 20 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Using polyfit For Discovery  polyfit of degree-1 ( n = 1 ) returns the parameters of a Line p 1 → m (slope) p 2 → b (intercept)  Thus polyfit can provide m & b for any of the previously noted functions AFTER the appropriate Linearization Transform

ENGR-25_Plot_Model-4.ppt 21 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods m & b by polyfit(x,y,1)  We need to find an Eqn for the Vapor pressure of Ethanol, C 2 H 5 OH, as a fcn of Temperature  Find P v vs T Data by Consulting P. E. Liley and W. R. Gambill, Chemical Engineers’ HandBk, New York, McGraw- Hill Inc., 1973, p & 3-54 P v for Ethanol (Torr) Temperature (Kelvins)

ENGR-25_Plot_Model-4.ppt 22 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods m & b by polyfit(x,y,1) cont  Since this a Vapor Pressure we Suspect an Antoine or Clapeyron Relation  P v ~ e m/T  As a Starting Point Make a Rectilinear Plot >> Pv = [1, 5, 10, 20, 40, 60, 100, 200, 400, 760]; >> T = [241.7, 261, 270.7, 281, 292, 299, 307.9, 321.4, 336.5, 351.4]; >> plot(T,Pv,'x', T,Pv,':'), xlabel('T (K)'), ylabel('Pv (Torr)'),... title('Ethanol Vapor Pressure'), grid

ENGR-25_Plot_Model-4.ppt 23 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Compare LogLog vs SemiLogY  Log Log Plot  logY vs linX  Looks like an Exponential in 1/T e.g., the Clapeyron eqn

ENGR-25_Plot_Model-4.ppt 24 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods m & b by polyfit(x,y,1) cont  The Plots Looks Pretty Well Exponential  For a 1 st -Cut Assume the Clapeyron form  Now Xform  Thus Plot ln(P v ) vs 1/T

ENGR-25_Plot_Model-4.ppt 25 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods m & b by polyfit(x,y,1) cont  The Command Session  Nicely Linear → Clapeyron is OK >> Ye = log(Pv); >> x = 1./T >> plot(x,Ye,'d', x,Ye,':'), xlabel('1/T (1/K)'), ylabel('ln(Pv) (ln(Torr))'),... title('Ethanol Vapor Pressure - Clapeyron Plot'), grid

ENGR-25_Plot_Model-4.ppt 26 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods m & b by polyfit(x,y,1) cont  Apply PolyFit to Find m and B >> p = polyfit(x,Ye,1) p = 1.0e+003 *  or  To Increase the Sig Figs displayed for B these plots are typically plotted with x1 = 1000/T >> x1 = 1000./T >> p1 = polyfit(x1,Ye,1) p1 =

ENGR-25_Plot_Model-4.ppt 27 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods m & b by polyfit(x,y,1) cont

ENGR-25_Plot_Model-4.ppt 28 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods All Done for Today Power and Exps

ENGR-25_Plot_Model-4.ppt 29 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Bruce Mayer, PE Licensed Electrical & Mechanical Engineer Engr/Math/Physics 25 Appendix

ENGR-25_Plot_Model-4.ppt 30 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Power Fcn Plot >> x =[7:91]; >> y = 13*x.^1.73; >> Xp = log(x); >> Yp = log(y); >> plot(x,y), xlabel('x'), ylabel('y'),... grid, title('Power Function') >> plot(Xp,Yp), xlabel('ln(x)'), ylabel('ln(y)'),... grid, title('Power Function')

ENGR-25_Plot_Model-4.ppt 31 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Exponential Fcn Plot >> t = [0:0.05:10]; >> v = 120*exp(-0.61*t); >> plot(t,v), xlabel('t'), ylabel('v'),... grid, title('Exponential Function') >> Ve = log(v); >> plot(t,Ve), xlabel('t'), ylabel('ln(v)'),... grid, title('Exponential Function')

ENGR-25_Plot_Model-4.ppt 32 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Altitude of Right Triangle  The Area of RIGHT Triangle  The Area of an ARBITRARY Triangle  By Pythagoras for Rt-Triangle

ENGR-25_Plot_Model-4.ppt 33 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Altitude of Right Triangle cont  Solving for h  Equating the A=½·Base·Hgt noting that

ENGR-25_Plot_Model-4.ppt 34 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Normalized Plot >> T = [69.4, 69.7, 71.6, 75.2, 76.3, 78.6, 80.6, 80.6, 82, 82.6, 83.3, 83.5, 84.3, 88.6, 93.3]; >> CPH = [15.4, 14.7, 16, 15.5, 14.1, 15, 17.1, 16, 17.1, 17.2, 16.2, 17, 18.4, 20, 19.8]; >> Tmax = max(T); >> Tmin = min(T); >> CPHmax = max(CPH); >> CPHmin = min(CPH); >> Rtemp = Tmax - Tmin; >> Rcroak = CPHmax - CPHmin; >> DelT = T - Tmin; >> DelCPH = CPH - CPHmin; >> Theta = DelT/Rtemp;DelCPH = CPH - CPHmin; >> Omega = DelCPH/Rcroak; >> plot(T, CPH,), grid >> plot(Theta,Omega), grid

ENGR-25_Plot_Model-4.ppt 35 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Start Basic Fitting Interface 1  FIRST → Plot the DATA

ENGR-25_Plot_Model-4.ppt 36 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Start Basic Fitting Interface 2 Expand Dialog Box Goodness of Fit; smaller is Better

ENGR-25_Plot_Model-4.ppt 37 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Start Basic Fitting Interface 3  Result  Chk by polyfit >> p = polyfit(Theta,Ome ga,1) p = 

ENGR-25_Plot_Model-4.ppt 38 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Caveat

ENGR-25_Plot_Model-4.ppt 39 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Greek Letters in Plots

ENGR-25_Plot_Model-4.ppt 40 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Plot “Discoverables”

ENGR-25_Plot_Model-4.ppt 41 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods % "Discoverable" Functions Displayed % Bruce Mayer, PE ENGR25 15Jul09 % x = linspace(-5, 5); ye = exp(x); ypp = x.^2; ypm = x.^(-2); % plot all 3 on a single graphe plot(x,ye, x,ypp, x,ypm),grid,legend('ye', 'ypp', 'ypm') disp('Showing MultiGraph Plot - Hit ANY KEY to continue') pause % % PLot Side-by-Side subplot(1,3,1) plot(x,ye), grid subplot(1,3,2) plot(x,ypp), grid subplot(1,3,3) plot(x,ypm), grid