私はこの表現を統合しようとしています:
ただし、機能の設定に問題があるようです。このMATLAB の説明で概説されているように、次のような 'NDfx.m' という名前の別の関数を定義しました。
function [ y ] = NDfx(x)
y = (1/sqrt(2*pi))*exp(-.5*x^2); % Error occurs here
end
ただし、メイン関数内で呼び出すと、上記のコメント行でエラーが発生します。私の主な機能は次のようになります。
function[P] = NormalDistro(u,o2,x)
delta = x-u;
dev = abs((delta)/o2); % Normalizes the parameters entered into function
P_inner = quad(@NDfx,-dev,dev); % Integrates function NDfx from -dev to dev (error here)
P_outer = 1 - P_inner; % Calculation of outer bounds of the integral
if delta > 0
P = P_inner + (P_outer/2);
elseif delta < 0
P = P_outer/2;
elseif dev == 0
P = .5;
end
end
私が得る特定のエラーは次のとおりです。
==> mpower のエラー
入力はスカラーおよび正方行列でなければなりません