⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cheby.m

📁 国外计算机科学教材系列 numerial method using matlab (third edition)
💻 M
字号:
function [C,X,Y]=cheby(fun,n,a,b)%Input   - fun is the string function to be approximated%        - N is the degree of the Chebyshev interpolating polynomial%        - a is the left endpoint%        - b is the right endpoint%Output  - C is the coefficient list for the polynomial%        - X contains the abscissas%        - Y contains the ordinates% NUMERICAL METHODS: MATLAB Programs%(c) 1999 by John H. Mathews and Kurtis D. Fink%To accompany the textbook:%NUMERICAL METHODS Using MATLAB,%by John H. Mathews and Kurtis D. Fink%ISBN 0-13-270042-5, (c) 1999%PRENTICE HALL, INC.%Upper Saddle River, NJ 07458if nargin==2, a=-1;b=1;endd=pi/(2*n+2);C=zeros(1,n+1);for k=1:n+1   X(k)=cos((2*k-1)*d);endX=(b-a)*X/2+(a+b)/2;x=X;Y=eval(fun);for k =1:n+1   z=(2*k-1)*d;   for j=1:n+1      C(j)=C(j)+Y(k)*cos((j-1)*z);   endendC=2*C/(n+1);C(1)=C(1)/2;   

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -