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

📄 test_floorplan.m

📁 斯坦福大学Grant和Boyd教授等开发的凸优化matlab工具箱
💻 M
字号:
% Example 8.7: Floorplan generation test script% Section 8.8.1/2, Boyd & Vandenberghe "Convex Optimization"% Joelle Skaf 12/04/05%% Rectangles aligned with the axes need to be place in the smallest% possible bounding box. No overlap is allowed. Each rectangle to be placed% can be reconfigured, within some limits.% In the current problem, 60 rectangles are to be place. We are given 2% acyclic graphs H and V (for horizontal and vertical) that specify the% relative positioning constraints of those rectangles.% We are also given minimal areas for the rectangles and aspect ratio% constraints% input dataload data_floorplan_60;rho = 1;Amin = 100*ones(1,n);[W, H, w, h, x, y] = floorplan(adj_H, adj_V, rho, Amin,ones(60,1)*0.5,ones(60,1)*2);fill([0; W; W; 0],[0;0;H;H],[1 1 1]);           % bounding boxhold onfor i=1:n    fill([x(i); x(i)+w(i); x(i)+w(i); x(i)],[y(i);y(i);y(i)+h(i);y(i)+h(i)],0.90*[1 1 1]);    hold on;    text(x(i)+w(i)/2, y(i)+h(i)/2,[int2str(i)]);endaxis([0 W 0 H]);axis equal; axis off;

⌨️ 快捷键说明

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