matlab 里正态分布的积分怎么算function y= fai(x)mu=600;sig=196.6292;y=(1./(sqrt(2*pi)*196.6292))*exp(-(x-600).^2/(2*196.6292*196.6292));end%%%%%%%%%%%%%%%%function y = tx(x)%UNTITLED3 Summary of this function goes here% Detailed explanation

来源:学生作业帮助网 编辑:作业帮 时间:2024/05/10 20:32:08
matlab 里正态分布的积分怎么算function y= fai(x)mu=600;sig=196.6292;y=(1./(sqrt(2*pi)*196.6292))*exp(-(x-600).^2/(2*196.6292*196.6292));end%%%%%%%%%%%%%%%%function y = tx(x)%UNTITLED3 Summary of this function goes here% Detailed explanation

matlab 里正态分布的积分怎么算function y= fai(x)mu=600;sig=196.6292;y=(1./(sqrt(2*pi)*196.6292))*exp(-(x-600).^2/(2*196.6292*196.6292));end%%%%%%%%%%%%%%%%function y = tx(x)%UNTITLED3 Summary of this function goes here% Detailed explanation
matlab 里正态分布的积分怎么算
function y= fai(x)
mu=600;
sig=196.6292;
y=(1./(sqrt(2*pi)*196.6292))*exp(-(x-600).^2/(2*196.6292*196.6292));
end
%%%%%%%%%%%%%%%%
function y = tx(x)
%UNTITLED3 Summary of this function goes here
% Detailed explanation goes here
global tem1;
t=tem1;
y=(-200*(x-t)+10+3000)*(1./(sqrt(2*pi)*196.6292))*exp(-(x-600).^2/(2*196.6292*196.6292));
end
%%%%%%%%
syms x
i=1;
global tem1;
y1=zeros(1,91);
y2=zeros(1,91);
for t=10:100
tem1=t;
y1(i)=quad(@tx,0,t);
y2(i)=10*quad(@fai,t,1300);
i=1+i;
end
程序如上 就是算不同t值下 函数tx 和 fai 关于x的积分 分别存入数组y1 y2 里 可是 matlab里面运行老出错
Error using ==> mtimes
Inner matrix dimensions must agree.
Error in ==> tx at 6
y=(-200*(x-t)+10+3000)*(1./(sqrt(2*pi)*196.6292))*exp(-(x-600).^2/(2*196.6292*196.6292));
Error in ==> quad at 77
y = f(x,varargin{:});
Error in ==> Untitled2 at 9
y1(i)=quad(@tx,0,t);

matlab 里正态分布的积分怎么算function y= fai(x)mu=600;sig=196.6292;y=(1./(sqrt(2*pi)*196.6292))*exp(-(x-600).^2/(2*196.6292*196.6292));end%%%%%%%%%%%%%%%%function y = tx(x)%UNTITLED3 Summary of this function goes here% Detailed explanation
y=(-200*(x-t)+10+3000)*(1./(sqrt(2*pi)*196.6292))*exp(-(x-600).^2/(2*196.6292*196.6292));
注意这句话exp前面的*号应该是.*因为这里是两个向量的元素分别相乘