Main Content

systemcomposer.analysis.loadInstance

Load architecture instance

Description

instance = systemcomposer.analysis.loadInstance(fileName,overwrite) 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.

example

Examples

collapse all

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

collapse all

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 as true so the load operation overwrites duplicate instances in the workspace or false).if not.

Output Arguments

collapse all

Loaded architecture instance, returned as a systemcomposer.analysis.ArchitectureInstance object.

More About

collapse all

Version History

Introduced in R2019a