Home > m2html > plot_Norm_C.m

plot_Norm_C

PURPOSE ^

% Read the matrices P0 and C

SYNOPSIS ^

This is a script file.

DESCRIPTION ^

% Read the matrices P0 and C

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 
0002 %% Read the matrices P0 and C
0003 [P0,Txt,Raw]=xlsread('P_matrix'); % Original probability transition matrix
0004 [C,Txt,Raw]=xlsread('C'); % Optimal minimal energy perturbation matrix
0005 P = P0+C;
0006 OneVec = ones(128,1);
0007 
0008 %% Compute C(s) versus s in Eq. (16)
0009 Norm_Cs = [];
0010 k = 1;
0011 for s = 0:10^(-3):1
0012    Cs = P - P0  + s*(OneVec*pid' - P);
0013    Norm_Cs(k) = norm(Cs);
0014    k = k+1;
0015 end
0016 
0017 
0018 %% Compute C_Qs versus s in Eq. (21)
0019 Norm_C_Qs = [];
0020 k = 1;
0021 for s = 0:10^(-3):1
0022    C_Qs = s*(OneVec*pid' - P0);
0023    Norm_C_Qs(k) = norm(C_Qs);
0024    k = k+1;
0025 end
0026 
0027 %% Plot
0028 figure; plot([0:10^(-3):1], Norm_Cs);
0029 hold on; ; plot([0:10^(-3):1], Norm_C_Qs, '-- r');
0030 xlabel('s'); legend ('||C(s)||','||C_Q(s)||' );
0031

Generated on Thu 27-May-2010 16:35:43 by m2html © 2005