Page 5 - Demo
P. 5


                                    Interface to Matlab%uf09f %uf09f RCP Consult 2017-2026 Page 5The assigned global names will have the very same names as in the Stochastic Model: Load, Strength, Diameter, PAR1, PAR2 and corresponding values. Each global vector will have 5 elements with corresponding values as ordered above.6. Matlab script fileThe script file containing a Function with a single input argument usually looks likefunction resultScalar = StrurelMatlab (XP)% Uses only vector notation to access values of Variables and Parameters.% The sequence in input vector XP is predefined by Stochastic Model.  resultScalar = XP(4)*(pi/4)*XP(2)*XP(3)^2 - XP(5)*XP(1);endHere elements of input vector %u2019XP%u2019 containing values from global vector v_XP_ can be accessed directly by an index, as is ordered in Stochastic Model of STRUREL.Alternatively, the assigned global names may be used also inside of functionfunction resultScalar = StrurelMatlab (XP)%{Uses global names of Variables and Parameters to access their values.The sequence is arbitrary. Both STRUREL and Matlab are case sensitive.%}% Parameters: global PAR1; global PAR2;% Random Variables: global Strength; global Diameter; global Load; resultScalar = PAR1*(pi/4)*Strength*(Diameter^2) - PAR2*Load;endDirect notation of both global vectors is also applicablefunction resultScalar = StrurelMatlab (XP)% Uses only vector notation to access values of Variables and Parameters.% The sequence in global vector v_XP_ is predefined by Stochastic Model.  resultScalar = v_XP_(4)*(pi/4)*v_XP_(2)*v_XP_(3)^2 - v_XP_(5)*v_XP_(1);endIt is permitted to use a mixed mode %u2013 global vectors, global names and arguments in the same function.
                                
   1   2   3   4   5   6   7   8   9   10