8:Advanced Mathematics Part 1:Fitting Curves to Data Part 2:Symbolic Mathematics ▣Part3:Calculus CDHAW @月协大学 TONGJI UNIVERSITY
8: Advanced Mathematics Part 1: Fitting Curves to Data Part 2: Symbolic Mathematics Part 3: Calculus
Advanced Mathematics(1/34) Fitting Curves to Data In this part,selected advanced mathematics and related built-in functions in the MATLAB software are introduced. >Fitting a curve to the data is often desired.Curve fitting is finding the curve that best fits the data. MATLAB has several curve-fitting functions.Some of the simplest curves are polynomials of different degrees, which are described next. 日濟大学 AW TONGJI UNIVERSITY
➢ In this part, selected advanced mathematics and related built-in functions in the MATLAB software are introduced. ➢ Fitting a curve to the data is often desired. Curve fitting is finding the curve that best fits the data. ➢ MATLAB has several curve-fitting functions. Some of the simplest curves are polynomials of different degrees, which are described next. Advanced Mathematics(1/34) Fitting Curves to Data
Advanced Mathematics(2/34) Fitting Curves to Data Polynomials Simple curves are polynomials of different degrees or orders.The degree is the integer of the highest exponent in the expression. For example: A straight line is a first-order(or degree 1)polynomial of the form ax b,or more explicitly ax+b. A quadratic is a second-order (or degree 2)polynomial of the form ax2 +bx +c. A cubic (degree 3)is of the form ax3+bx2+cx+d. 翻月停大学 TONGJI UNIVERSITY
Advanced Mathematics(2/34) Fitting Curves to Data
Advanced Mathematics(3/34) Fitting Curves to Data The built-in functions sym2poly and poly2sym convert from symbolic expressions to polynomial vectors and vice versa. For example: >>myp=[12-43]: >poly2sym(myp) ans= x^3+2*×^2-4*X+3 >>mypo1y=[20-105]: >poly2sym(mypoly) ans= 2*x^4-×^2+5 >sym2poly (ans) ans @日济大学 2 TONGJIUNIVE具sITY
Advanced Mathematics(3/34) Fitting Curves to Data ➢ The built-in functions sym2poly and poly2sym convert from symbolic expressions to polynomial vectors and vice versa. For example:
Advanced Mathematics(4/34) Fitting Curves to Data The roots function in MATLAB can be used to find the roots of an equation represented by a polynomial. For example:for the mathematical function 4x3-2x2-8x+3 to solve the equation f(x)=0: >>roots([4-2-83]) ans= -1.3660 1.5000 0.3660 CDHAW @月协大学 TONGJI UNIVERSITY
Advanced Mathematics(4/34) Fitting Curves to Data