splineex.mht

来自「it is a very essential matlab code.」· MHT 代码 · 共 34 行

MHT
34
字号
From: <Saved by Windows Internet Explorer 7>
Subject: 
Date: Tue, 12 May 2009 09:50:19 -0700
MIME-Version: 1.0
Content-Type: text/html;
	charset="Windows-1252"
Content-Transfer-Encoding: 7bit
Content-Location: http://www.mece.ualberta.ca/Courses/mec390/390code/splineex.m
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3350

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=windows-1252">
<META content="MSHTML 6.00.6000.16825" name=GENERATOR></HEAD>
<BODY><PRE>
% demonstrate spline and polyint functions

clear;                                 % clear variables

min = -5;                              % range of x values
max = 5;
x = min:1:max;                         % define x values

y = sin(x);	                       % define y values

xi = min:0.1:max;                      % x values to be interpolated at
yi = spline(x,y,xi);                   % spline interpolation
yii = polyint(x,y,xi);                 % polynomial interpolation

plot (x,y,'o',xi,yi,'-',xi,yii,'-.');  % plot and compare

legend('raw data','cubic spline','poly inter');
</PRE></BODY></HTML>

⌨️ 快捷键说明

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