| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → Simulink Design Optimization |
| Contents | Index |
| Learn more about Simulink Design Optimization |
constraints=findconstr(proj,'blockname')
constraints=findconstr(proj,'blockname') extracts design requirements specified in the Signal Constraint block blockname of the Simulink model associated with the response optimization project proj. constraints contains data that defines the design requirements. Modify the UpperBoundX, UpperBoundY, LowerBoundX and LowerBoundY properties of constraints to specify new design requirements, and the ReferenceX and ReferenceY properties to add a reference signal. The Simulink model associated with proj must be open.
Note The Signal Constraint block does not update to display the modified constraints and reference signal. However, the updated constraint bounds and reference signal specified in the constraint object are used when you optimize the parameters from the command line. |
Retrieve the constraints specified in the Signal Constraint block of the model associated with the response optimization project:
% Open the Simulink model
srotut1
% Create a response optimization project with default settings and
% parameters to optimize
proj=newsro('srotut1','Kint');
% Retrieve the constraints for this project
constraint=findconstr(proj,'srotut1/Signal Constraint')Change the positioning of the constraint bounds by editing the upper- and lower-bound matrices:
constraint.UpperBoundY=[1.1 1.1;1.01 1.01]; constraint.UpperBoundX=[0 30;30 50]; constraint.LowerBoundY=[0 0;0.9 0.9;0.99 0.99]; constraint.LowerBoundX=[0 15;15 30;30 50];
If you add these constraints graphically in the Signal Constraint block, the constraints appear as shown in the following figure. To learn more about how to add constraints graphically, see Specifying Design Requirements.

Include a reference signal using the following commands:
constraint.CostEnable='on'; constraint.ReferenceX=linspace(0,50,1000); constraint.ReferenceY=1-exp(-linspace(0,50,1000));
If you include the reference signal graphically in the Signal Constraint block, the reference signal appears as shown in the following figure. To learn more about how to specify a reference signal, see Tracking Reference Signals.

![]() | Functions — Alphabetical List | finddepend | ![]() |

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |