如何把这个cauchycdf函数改成laplacecdf呢?。
이전 댓글 표시
如题,cauchycdf函数是我在网上找的附件中有分享给大家,那么可不可以将他改成拉普拉斯的累积分布函数laplacecdf呢?
cauchycdf是这样的
% Default values
a= 0.0;
b= 1.0;
% Check the arguments
if(nargin >= 2)
a= varargin{1};
if(nargin == 3)
b= varargin{2};
b(b <= 0)= NaN; % Make NaN of out of range values.
end
end
if((nargin < 1) || (nargin > 3))
error('At least one argument, at most three!');
end
% Calculate
p= 0.5 + atan((x-a)./b)/pi;
end
我想直接把倒数第二行直接改为
p= 0.5.*(1+sign(x-b).*(1-exp(-abs(x-a)./b)));但是不行,请教一下各位老师
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Computational Fluid Dynamics (CFD)에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!