Return intersection of two arrays ofSimulink.VariableUsage
对象
returns an array that identifies the variables described inVarsOut
= intersect(VarsIn1
,VarsIn2
)VarsIn1
and inVarsIn2
, which are arrays ofSimulink.VariableUsage
对象. If a variable is described by aSimulink.VariableUsage
object inVarsIn1
and inVarsIn2
, the function returns aSimulink.VariableUsage
object that stores the variable usage information from both objects in theUsers
property.
intersect
compares theName
,Source
, andSourceType
properties of theSimulink.VariableUsage
对象inVarsIn1
with the same properties of the objects inVarsIn2
. IfVarsIn1
andVarsIn2
each containSimulink.VariableUsage
对象that have the same values for these three properties, they both describe the same variable.
To createSimulink.VariableUsage
对象that describe the usage of variables in a model, use theSimulink.findVars
function.