Zero-order one-class besell Function Curve and Its Envelope Matlab source program

Source: Internet
Author: User

Please refer to the sourceProgram:

 
Clear, CLC; format longx = (0: 0. 0:100) '; y_0 = besselj (0, x); % Y_1 = besselj (1, x); % level 1. Here, only order 0% y_2 = besselj (2, x); % second-order plot (x, y_0); grid on; axis ([0,100,-]); Title ('0-order besell Function Curve '); xlabel ('variable x'); ylabel ('variable y'); % draw envelope hold on; [Up, down] = envelope (x, y_0, 'spline '); plot (x, up, 'R'); plot (x, down, 'R ');

The envelope is a separate. M file, which is a function used to draw an envelope. To put it bluntly, it is to calculate the inflection point and then interpolation:

Function [Up, down] = envelope (X, Y, interpmethod) % envelope gets the data of upper and down envelope of the known input (x, y ). % input parameters: % x the abscissa of the given data % Y the ordinate of the given data % interpmethod the interpolation method % output parameters: % up the upper envelope, which has the same length as X. % down the down envelope, which has the same length as X. % See also diff Interp1 % designed by: Lei Wang, <WangLeiBox@hotmail.com>, 11-Mar-2003.% last revision: 21-Mar-2003.% Dept. mechanical & aerospace engineering, NC State University. % $ revision: 1.1 $ Date: 3/21/2003 am $ if length (x )~ = Length (y) error ('two input data shocould have the same length. '); endif (nargin <2) | (nargin> 3), error ('Please see help for input data. '); elseif (nargin = 2) interpmethod = 'linear '; end % find the extreme Maxim values % and the corresponding indexes % values extrmaxvalue = Y (find (diff (sign (diff (y) =-2) + 1 ); extrmaxindex = find (diff (sign (diff (y) =-2) + 1; % find the extreme minim values % and the corresponding indexes % values extrminvalue = Y (find (diff (sign (diff (y) = + 2) + 1 ); extrminindex = find (diff (sign (diff (y) = + 2) + 1; up = extrmaxvalue; up_x = x (extrmaxindex); down = extrminvalue; down_x = x (extrminindex); % interpolation of the Upper/down envelope data % merge up = interp1 (up_x, up, X, interpmethod); down = interp1 (down_x, down, x, interpmethod );

Effect:

Source program download: http://www.pudn.com/downloads495/sourcecode/windows/other/detail2062657.html

No MATLAB exists in the resource tags Uploaded By csdn. Why ....

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.