Skip to content

Commit 2d65a26

Browse files
committed
Changes on the script for plooting the Feasible Region
Add fill and save points
1 parent b530409 commit 2d65a26

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed
10 Bytes
Binary file not shown.

script_generate_feasible_region_modified.m

+12-7
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,10 @@
5959

6060
xk=sdpvar(2,1);
6161

62-
B{2,1}=[0.445;1];
62+
B{2,1}=input('Enter value for B{2,1} (default =[0;1]) => ');
63+
if isempty(B{2,1})
64+
B{2,1}=[0;1];
65+
end
6366

6467
%% LMI 11
6568

@@ -109,10 +112,14 @@
109112

110113
%% Plot
111114

115+
npoints=100;
116+
112117
tfig=0;
113118
tfig=tfig+1;
114119
figure(tfig);
115-
plot(LMIs_jianbo,xk,'b',[],opts);
120+
p=plot(LMIs_jianbo,xk,'b',npoints,opts);
121+
p=cell2mat(p)';
122+
fill(p(:,1),p(:,2),'blue','LineWidth',2,'FaceAlpha',.3);
116123
if flagc == 1
117124
title(sprintf('Feasible Region - Input constraint with u_{max} = %g',umax));
118125
else
@@ -123,15 +130,13 @@
123130
% Doing it again just to save the points
124131

125132
if flagc == 1
126-
s=sprintf('points_feasreg_jianbo_u_constraint_N_%d_umax_%s=plot(LMIs_jianbo,xk,''b'',[],opts);',N,strrep(num2str(umax),'.','_'));
133+
s=sprintf('points_feasreg_jianbo_u_constraint_N_%d_umax_%s=p;',N,strrep(num2str(umax),'.','_'));
127134
elseif flagc == 2
128-
s=sprintf('points_feasreg_jianbo_u_and_x_constraints_N_%d_umax_%s_xmax_%s=plot(LMIs_jianbo,xk,''b'',[],opts);',N,strrep(num2str(umax),'.','_'),strrep(num2str(xmax),'.','_'));
135+
s=sprintf('points_feasreg_jianbo_u_and_x_constraints_N_%d_umax_%s_xmax_%s=p;',N,strrep(num2str(umax),'.','_'),strrep(num2str(xmax),'.','_'));
129136
else
130-
s=sprintf('points_feasreg_jianbo_no_constraints_N_%d=plot(LMIs_jianbo,xk,''b'',[],opts);',N);
137+
s=sprintf('points_feasreg_jianbo_no_constraints_N_%d=p;',N);
131138
end
132139

133-
disp('Doing it again just to save the feasible region');
134-
135140
eval(s);
136141

137142
if exist('data','dir') ~= 7 % Please see help for exist

0 commit comments

Comments
 (0)