Home > utility > gBellParam.m

gBellParam

PURPOSE ^

gBellParam: Compute the parameters of gBellMf

SYNOPSIS ^

function [a, b, c]=gBellParam(d1, s1, d2, s2, plotOpt)

DESCRIPTION ^

 gBellParam: Compute the parameters of gBellMf

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SUBFUNCTIONS ^

SOURCE CODE ^

0001 function [a, b, c]=gBellParam(d1, s1, d2, s2, plotOpt)
0002 % gBellParam: Compute the parameters of gBellMf
0003 
0004 if nargin<1, selfdemo; return; end
0005 if nargin<5, plotOpt=0; end
0006 
0007 t1=(1-s1)/s1;
0008 t2=(1-s2)/s2;
0009 
0010 c=0;
0011 b=(log(t1/t2)/log(d1/d2))/2;
0012 a=d1*(1/t1)^(1/(2*b));
0013 
0014 if plotOpt
0015     x=max(abs([d1, d2, 2*d1, 2*d2]));
0016     x=linspace(x, -x);
0017     y=gbellmf(x, [a, b, c]);
0018     plot(x, y);
0019     line(d1, s1, 'marker', 'o', 'color', 'r');
0020     line(d2, s2, 'marker', 'o', 'color', 'r');
0021 end
0022 
0023 % ====== Selfdemo
0024 function selfdemo
0025 d1=1.53;
0026 s1=0.95;
0027 d2=2.35;
0028 s2=0.3;
0029 [a,b,c]=gBellParam(d1, s1, d2, s2, 1);

Generated on Tue 01-Jun-2010 09:50:34 by m2html © 2003