资源简介
plot (on log-log axes) the empirical distribution along with the fitted power-law distribution
代码片段和文件信息
function h=plplot(x xmin alpha)
% reshape input vector
x = reshape(xnumel(x)1);
% initialize storage for output handles
h = zeros(21);
% select method (discrete or continuous) for plotting
if isempty(setdiff(xfloor(x))) f_dattype = ‘INTS‘;
elseif isreal(x) f_dattype = ‘REAL‘;
else f_dattype = ‘UNKN‘;
end;
if strcmp(f_dattype‘INTS‘) && min(x) > 50
f_dattype = ‘REAL‘;
end;
% estimate xmin and alpha accordingly
switch f_dattype
case ‘REAL‘
n = length(x);
c = [sort(x) (n:-1:1)‘./n];
q = sort(x(x>=xmin));
cf = [q (q./xmin).^(1-alpha)];
cf(:2) = cf(:2) .* c(find(c(:1)>=xmin1‘first‘)2);
figure;
h(1) = loglog(c(:1)c(:2)‘bo‘‘MarkerSize‘8‘MarkerFaceColor‘[1 1 1]); hold on;
h(2) = loglog(cf(:1)cf(:2)‘k--‘‘LineWidth‘2); hold off;
xr = [10.^floor(log10(min(x))) 10.^ceil(log10(max(x)))];
xrt = (round(log10(xr(1))):2:round(log10(xr(2))));
if length(xrt)<4 xrt = (round(log10(xr(1))):1:round(log10(xr(2)))); end;
yr = [10.^floor(log10(1/n)) 1];
yrt = (round(log10(yr(1))):2:round(log10(yr(2))));
if length(yrt)<4 yrt = (round(log10(yr(1))):1:round(log10(yr(2)))); end;
set(gca‘XLim‘xr‘XTick‘10.^xrt);
set(gca‘YLim‘yr‘YTick‘10.
- 上一篇:小波熵matlab程序
- 下一篇:自己编写卷积程序 matlab
相关资源
- 最小二乘法曲线拟合的matlab实现
- 贝塞尔曲线拟合效果非常好
- 复杂网络幂律分布matlab仿真程序
- 粒子群算法求解BP神经网络参数
- 一阶惯性加延迟环节的matlab曲线拟合
- 三维曲线拟合函数的MATLAB程序
- matlab三维曲线拟合
- matlab下的幂律拟合函数
- NURBS_MATLAB
- 三维B样条曲线拟合Matlab程序
- Matlab三维曲线拟合源码
- 基于matlab中polyfit函数代码进行拟合
- SVM function available 可实现SVM函数曲线拟
- 最小二乘法的平面拟合去除图像背景
- MATALAB1 MATLAB三维曲线拟合
- 方便大家使用的最小二乘法曲线拟合
- 1-8阶贝塞尔曲线拟合matlab源码(含拟
- 遗传算法曲线拟合.zip
评论
共有 条评论