このページの内容は最新ではありません。最新版の英語を参照するには、ここをクリックします。
integrate
cfit
オブジェクトの積分
説明
例
関数 integrate
を使用した近似の積分の算出
ベースラインの正弦波信号を作成します。
xdata = (0:.1:2*pi)'; y0 = sin(xdata);
応答依存ガウス ノイズを信号に付加します。
noise = 2*y0.*randn(size(y0)); ydata = y0 + noise;
ノイズを含むデータにカスタムの正弦波モデルを当てはめます。
f = fittype('a*sin(b*x)'); fit1 = fit(xdata,ydata,f,'StartPoint',[1 1]);
予測子値について近似の積分を求めます。
int = integrate(fit1,xdata,0);
データ、近似、積分をプロットします。
subplot(2,1,1) plot(fit1,xdata,ydata) % cfit plot method subplot(2,1,2) plot(xdata,int,'m') % double plot method grid on legend('integral')
また、cfit
plot
メソッドを使用して積分を直接計算しプロットすることもできます。
figure plot(fit1,xdata,ydata,{'fit','integral'})
ただし、plot
メソッドは積分のデータを返しません。
入力引数
fun
— 関数 cfit
cfit
積分する関数。cfit
オブジェクトとして指定します。
x
— 積分点
数値ベクトル
関数を積分する点。数値ベクトルとして指定します。
x0
— 積分の下限
数値スカラー
積分の下限。数値スカラーとして指定します。
出力引数
int
— 積分結果
数値ベクトル
積分の結果。x と同じサイズの数値ベクトルとして返されます。
バージョン履歴
R2006a より前に導入
MATLAB コマンド
次の MATLAB コマンドに対応するリンクがクリックされました。
コマンドを MATLAB コマンド ウィンドウに入力して実行してください。Web ブラウザーは MATLAB コマンドをサポートしていません。
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)