Page 5 - Demo
P. 5


                                    Interface to Matlab%uf09f%uf09fRCPConsult2017-2025Page 5The assigned global nameswill have the very same names as in the Stochastic Model: Load, Strength, Diameter, PAR1, PAR2and corresponding values. Each global vectorwill have 5 elements with corresponding values as ordered above.6.Matlabscript fileThe script file containing a Functionwith a single input argument usually looks likefunctionresultScalar =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%u2019containing values from global vectorv_XP_can be accessed directly by an index, as is ordered in Stochastic Model of STRUREL.Alternatively, the assigned global namesmay be used also inside of functionfunctionresultScalar =StrurelMatlab(XP)%{Uses global names of Variables and Parameters to access their values.The sequence is arbitrary. Both STRUREL and Matlabare case sensitive.%}% Parameters:globalPAR1;globalPAR2;% Random Variables:globalStrength;globalDiameter;globalLoad;resultScalar =PAR1*(pi/4)*Strength*(Diameter^2)-PAR2*Load;endDirect notation of both global vectorsis also applicablefunctionresultScalar =StrurelMatlab(XP)% Uses only vector notation to access values of Variables and Parameters.% The sequence in globalvector 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 %u2013global vectors, global namesand arguments in the same function.
                                
   1   2   3   4   5   6   7   8   9   10