Matlab function credits

Source: Internet
Author: User

Matlab function credits


One-dimensional function (important) points:

The quad function, quadl function, and INT function are used to calculate the integral points of a mona1 function:



Quad and quadl:

Quad and quadl use different algorithms. Generally, quadl is more accurate.

Example: points obtained:

f=inline('sqrt(4*cos(2*t).^2+sin(t).^2+1)');disp(quad(f, 0, 3*pi));

Or:

F = @ (t) (SQRT (4 * Cos (2 * t ). ^ 2 + sin (t ). ^ 2 + 1); disp (QUAD (F, 0, 3 * PI); % displays the credit value


In Quad (F, lower, upper), F is the handle of the product function, lower is the lower threshold of points, upper is the upper limit of points, and quad returns the integral value. The usage of the quadl function is similar.



INT:

The Int function can also be used to evaluate the unary function. The difference between the int function and the quad function (or quadl function) is that the int function can solve indefinite points, while the quad function (or quadl function) can only solve the definite points. In addition, the int function uses the Newton-levenitz method. Therefore, the int function cannot be used to find complicated product functions. The quad function uses the area method under the curve, so it is suitable for most of the product functions.

Example: points obtained:

Syms X; F = (log (X)/(1 + x) ^ 2; disp (INT (f, x, 0, 1); % displays the credit value


Note: When Using int to solve points, you must first define a symbol variable!

F In int (f, x, lower, upper) is a function containing symbol variables, X is a symbol variable, and lower and upper are the lower limit of points respectively.



Binary Function (dual) points:

You can use the dblquad function to calculate binary function credits:

Example: points obtained:

f=@(x, y)(y.*sin(x)+x.*cos(y));xmin=pi;xmax=2*pi;ymin=0;ymax=pi;disp(dblquad(f, xmin, xmax, ymin, ymax));

In dblquad (F, xmin, xmax, ymin, Ymax), F is the handle of the product function,XminIs the minimum internal credit limit,XmaxYesInmostCredit Limit,YminIs the lower limit of external credits, ymAxIs the external credit limit, DBLQuad returns the point value. You can use the triplequad function for triple points. The usage is similar.


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.