| 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 |
uncpar=gridunc('ParameterName',Values,...)
uncpar=gridunc('ParameterName',Values,...) constructs a multi-dimensional grid that contains all value combinations of uncertain parameters ParameterName. uncpar contains the uncertain parameter values.
ParameterName_n |
Name of the uncertain parameter in a response optimization project. |
Values_n |
Values of corresponding uncertain parameter ParameterName_n:
|
Create a grid of values for vector-valued uncertain parameters:
uset=gridunc('Kp',{[1;4],[1;4]},'Kd',...
{[0.1;0.3;0.2],[0.1;0.3;0.2],[0.1;0.3;0.2]})Create and enable a grid of values for uncertain parameters to test model robustness:
% Create a grid of values for the uncertain parameters P, I and D.
uset=gridunc('P',[1,2,3,4],'I',[0.1,0.2,0.3],'D',[30,35,40])
% View values for the uncertain parameter P.
uset.P
% The default value of the Optimized property of uset is false.
% This implies that the uncertain parameter values are not
% enabled for testing model robustness.
% Set the value to true to enable uncertain parameter values.
uset.Optimized(1:end)=true;For parameters with values specified as {first_value,...,last_value} or [first_value,...,last_value], gridunc creates a hypercube which consists of:
2S vertices, where S is the number of parameters. first_value and last_value of each parameter form the vertices of the hypercube.
Number of samples equal to the product of number of values specified for each parameter.
To create a grid of uncertain parameter values using the GUI:
In the Simulink model, double-click the Signal Constraint block to open the Block Parameters: Signal Constraint window.
In the Block Parameters window, select Optimization > Uncertain Parameters to open the Uncertain Parameters dialog box.
Select Grid as the Sampling method.
Specify the uncertain parameters and their values:
Click Add to open the Add Parameters dialog box.
Select the uncertain parameters and click OK to add them to the Uncertain Parameters dialog box.
Specify the values for the corresponding parameter in the Sample Values column.
![]() | getsro | initpar | ![]() |

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 |