%% Create Multidimensional Optimization Variables
% Create a 3-by-4-by-2 array of optimization variables named xarray.

xarray = optimvar('xarray',3,4,2)

%
% You can also create multidimensional variables indexed by a mixture of names and numeric indices. For example, create a 3-by-4 array of optimization variables where the first dimension is indexed by the strings 'brass', 'stainless', and 'galvanized', and the second dimension is numerically indexed.

bnames = ["brass","stainless","galvanized"];
bolts = optimvar('bolts',bnames,4)

%
% Copyright 2012 The MathWorks, Inc.