?? genfig_5a.m
字號:
% GENFIG_5A Reproduces figure 5a.
%
% USAGE
%
% GENFIG_5A(color, display, filename)
%
% INPUTS
%
% color Color (true) or grayscale (false) (optional, default = true)
% display Displays (true) or does not display (false) the figure (optional, default = true)
% filename Saves the figure in eps format under the name 'filename' (optional, default = not saved)
%
% COPYRIGHT
%
% This file is part of the Matlab code provided for the following
% reproducible paper:
%
% Olivier Roy and Martin Vetterli,
% "Dimensionality Reduction for Distributed Estimation in the Infinite Dimensional Regime",
% vol. 54, no. 4, pp. 1655-1669, April 2008.
%
% This program is free software; you can redistribute it and/or modify it
% under the terms of the GNU General Public License as published by the
% Free Software Foundation; either version 2 of the License, or (at your
% option) any later version. This software is distributed in the hope that
% it will be useful, but without any warranty; without even the implied
% warranty of merchantability or fitness for a particular purpose.
% See the GNU General Public License for more details
% (enclosed in the file GPL).
%
% GNU General Public License,
% Copyright (C) 2008,
% Audiovisual Communications Laboratory (LCAV),
% Ecole Polytechnique F閐閞ale de Lausanne (EPFL),
% CH-1015 Lausanne.
%
% COMMENTS
%
% Author: Olivier Roy
% Latest modifications: April 2, 2008.
function genfig_5a(color, display, filename)
% We set the default values for the input arguments
save = true;
if nargin < 3
save = false;
end
if nargin < 2
display = true;
end
if nargin < 1
color = true;
end
% We compute the infinite block-length distortion (IBLD) for different values of rho and alpha
rho_val = [0:0.1:0.9];
alpha_val = [0:0.01:1];
IBLD_val = zeros(length(alpha_val), length(rho_val));
for i=1:length(rho_val)
rho = rho_val(i);
IBLD_val(:,i) = 1 - (2/pi)*atan(((1+rho)/(1-rho))*tan(pi*alpha_val/2));
end
% We plot the figure
figure;
if (color)
plot(alpha_val, IBLD_val, 'b-');
else
plot(alpha_val, IBLD_val, 'k-');
end
box on
grid on
if save
xlabel('xLabel');
ylabel('yLabel');
title('title');
saveas(gcf, filename,'psc2');
end
if display
xlabel('\alpha');
ylabel('MSE');
else
close gcf
end
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -