systemcomposer.analysis.loadInstance - Load architecture instance - MATLAB (original) (raw)
Main Content
Load architecture instance
Syntax
Description
[instance](#mw%5Fc75f05bb-ecb1-4dbd-b26a-bc5ecb74f36a) = systemcomposer.analysis.loadInstance([fileName](#mw%5F34651c5c-c425-4b14-b4c3-079a163667eb),[overwrite](#mw%5Fea59a959-c3b3-4e45-999c-4284c38f0813))
loads an architecture instance from a MAT
-file.
Note
This function is part of the instance programmatic interfaces that you can use to analyze the model iteratively, element-by-element. The instance
refers to the element instance on which the iteration is being performed.
Examples
Create a profile for latency characteristics and save it.
profile = systemcomposer.profile.Profile.createProfile("LatencyProfile");
latencybase = profile.addStereotype("LatencyBase"); latencybase.addProperty("latency",Type="double"); latencybase.addProperty("dataRate",Type="double",DefaultValue="10");
connLatency = profile.addStereotype("ConnectorLatency",... Parent="LatencyProfile.LatencyBase"); connLatency.addProperty("secure",Type="boolean"); connLatency.addProperty("linkDistance",Type="double");
nodeLatency = profile.addStereotype("NodeLatency",... Parent="LatencyProfile.LatencyBase"); nodeLatency.addProperty("resources",Type="double",DefaultValue="1");
portLatency = profile.addStereotype("PortLatency",... Parent="LatencyProfile.LatencyBase"); portLatency.addProperty("queueDepth",Type="double"); portLatency.addProperty("dummy",Type="int32");
profile.save
Instantiate all stereotypes in the profile.
model = systemcomposer.createModel("archModel"); systemcomposer.openModel("archModel"); instance = instantiate(model.Architecture,"LatencyProfile","NewInstance");
Save the architecture instance.
instance.save("InstanceFile");
Delete the architecture instance.
systemcomposer.analysis.deleteInstance(instance);
Load the architecture instance.
loadedInstance = systemcomposer.analysis.loadInstance("InstanceFile");
Input Arguments
MAT
-file that contains architecture instance, specified as a character vector or string.
Data Types: char
| string
Whether to overwrite instance if it already exists in workspace, specified astrue
so the load operation overwrites duplicate instances in the workspace or false
).if not.
Output Arguments
More About
Term | Definition | Application | More Information |
---|---|---|---|
Analysis | Static analysis analyzes the structure of the system to quantitatively evaluate an architecture for certain characteristics. Static analysis uses an analysis function and parametric values of properties and parameters captured in the system model. | Use analyses to calculate overall reliability, mass roll-up, performance, or thermal characteristics of a system, or to perform a size, weight, and power (SWaP) analysis to increase efficiency. | Analyze Architecture Model Properties with Analysis FunctionAnalyze ArchitectureSimple Roll-Up Analysis Using Robot System with Properties |
Analysis function | An analysis function is a MATLAB® function that computes values necessary to evaluate the architecture using the properties of each element in the model instance and instance-specific parameters at the component and architecture levels. | Use an analysis function to calculate the result of an analysis. | Analysis Function ConstructsWrite Analysis Function |
Instance model | An instance model is a collection of instances. | You can update an instance model with changes to a model, but the instance model will not update with changes in active variants or model references. You can use an instance model, saved in a MAT file, of a System Composerâ„¢ architecture model for analysis. | Run Analysis Function |
Instance | An instance is an occurrence of an architecture model element at a given point in time. | An instance freezes the active variant or model reference of the component in the instance model. | Create a Model Instance for Analysis |
Version History
Introduced in R2019a
See Also
Tools
Functions
- instantiate | iterate | lookup | save | update | refresh | systemcomposer.analysis.deleteInstance | getValue | setValue | hasValue | getParameter | getEvaluatedParameterValue | getParameterNames | getParameterValue | setParameterValue | isArchitecture | isComponent | isConnector | isPort | getQualifiedName
Objects
- systemcomposer.analysis.Instance | systemcomposer.analysis.ArchitectureInstance | systemcomposer.analysis.ComponentInstance | systemcomposer.analysis.PortInstance | systemcomposer.analysis.ConnectorInstance