⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ex_8_3.m

📁 斯坦福大学Grant和Boyd教授等开发的凸优化matlab工具箱
💻 M
字号:
% Example 8.3: Bounding correlation coefficients% Boyd & Vandenberghe "Convex Optimization"% Joelle Skaf - 10/09/05%% Let C be a correlation matrix. Given lower and upper bounds on% some of the angles (or correlation coeff.), find the maximum and minimum% possible values of rho_14 by solving 2 SDP's%           minimize/maximize   rho_14%                        s.t.   C >=0%                               0.6 <= rho_12 <=  0.9%                               0.8 <= rho_13 <=  0.9%                               0.5 <= rho_24 <=  0.7%                              -0.8 <= rho_34 <= -0.4n = 4;% Upper bound SDPfprintf(1,'Solving the upper bound SDP ...');cvx_begin sdp    variable C1(n,n) symmetric    maximize ( C1(1,4) )    C1 >= 0;    diag(C1) == ones(n,1);    C1(1,2) >= 0.6;    C1(1,2) <= 0.9;    C1(1,3) >= 0.8;    C1(1,3) <= 0.9;    C1(2,4) >= 0.5;    C1(2,4) <= 0.7;    C1(3,4) >= -0.8;    C1(3,4) <= -0.4;cvx_endfprintf(1,'Done! \n');% Lower bound SDPfprintf(1,'Solving the lower bound SDP ...');cvx_begin sdp    variable C2(n,n) symmetric    minimize ( C2(1,4) )    C2 >= 0;    diag(C2) == ones(n,1);    C2(1,2) >= 0.6;    C2(1,2) <= 0.9;    C2(1,3) >= 0.8;    C2(1,3) <= 0.9;    C2(2,4) >= 0.5;    C2(2,4) <= 0.7;    C2(3,4) >= -0.8;    C2(3,4) <= -0.4;cvx_endfprintf(1,'Done! \n');% Displaying resultsdisp('--------------------------------------------------------------------------------');disp(['The minimum and maximum values of rho_14 are: ' num2str(C2(1,4)) ' and ' num2str(C1(1,4))]);disp('with corresponding correlation matrices: ');disp(C2)disp(C1)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -