Main Content

removeStartingPoint

Class: SLSlicerAPI.SLSlicer
Namespace: SLSlicerAPI

Remove starting point for model slice

Description

removeStartingPoint(obj,StartingPoint) removes the starting point in StartingPoint from the model slice in obj for dependency analysis.

removeStartingPoint(obj,PortHandle,busElementPath) removes the starting point defined using the port handle in PortHandle and the bus element path in busElementPath. Removing a bus element also removes all its children added as starting points.

Input Arguments

expand all

Class containing of Model Slicer configuration options.

Block or signal line from which the Model Slicer analysis is started.

The outport handle of a port emitting the bus.

The path for the bus element from which the Model Slicer analysis is started.

Examples

Remove Starting Point using Blocks Handles

Specifies the block handle. To get the block handle, use the getSimulinkBlockHandle command.

Open the model.

open_system('sldvSliceClimateControlExample');
obj = slslicer('sldvSliceClimateControlExample');
blkH = get_param('sldvSliceClimateControlExample/Out1','Handle');
addStartingPoint(obj,blkH);
removeStartingPoint(obj,blkH);

To remove multiple block handles as the starting point, use a cell array.

blkH = {get_param('sldvSliceClimateControlExample/Out1','Handle'),...
    get_param('sldvSliceClimateControlExample/Out2','Handle')};
addStartingPoint(obj,blkH);
removeStartingPoint(obj,blkH);

Remove Bus Elements from Starting Points

Remove the bus element upper_saturation_limit from the bus limits as starting point. This example shows how to first add upper_saturation_limit.

openExample('sldemo_mdlref_bus');
obj = slslicer('sldemo_mdlref_bus');
ph = get_param('sldemo_mdlref_bus/COUNTERBUSCreator1', 'PortHandles');
obj.addStartingPoint(ph.Outport, "limits.upper_saturation_limit");
obj.highlight;
Once you have added bus element upper_saturation_limit as a starting point, you can remove this bus element from starting point by using:
obj.removeStartingPoint(ph.Outport, "limits.upper_saturation_limit");
Removing the bus limits from starting point will also remove its child upper_saturation_limit from starting point.

Remove Starting using Blocks Paths

Block path name, specified as a character vector or a cell array of character vectors.

bPath = {'sldvSliceClimateControlExample/Out1'};
removeStartingPoint(obj, bPath);

To remove multiple block paths starting point, use cell array, for example:

bPath = {'sldvSliceClimateControlExample/Out1',...
'sldvSliceClimateControlExample/Heater/HeaterAct'};
removeStartingPoint(obj, bPath);

Remove Starting using SID

Simulink® Identifier, a unique designation assigned to a Simulink block or model annotation. To get the SID, use the Simulink.ID.getSID command.

removeStartingPoint(obj, 'sldvSliceClimateControlExample:39')

Remove Starting using LineHs

Handles of line that connects from the Inport block to the Outport block. To get the Line Handle, use get_param command.

 lh1 = get_param('sldvSliceClimateControlExample/Heater/Heat','LineHandles');
 lh2 = get_param('sldvSliceClimateControlExample/Heater','LineHandles');
 LineHs = [lh1.Inport(1), lh2.Outport(2)];
removeStartingPoint(obj,LineHs);

Alternatives

To open the Model Slicer manager, in the Simulink Editor, on the Apps tab, click Model Slicer. To remove a block or signal as the starting point, in the model, right-click the bus signal and select Model Slicer > Remove as Starting Point.

To remove bus element(s) as a starting point, in the model, right-click the bus signal and select Model Slicer > Remove Bus Elements from Starting Points. This removes all the bus element starting points corresponding to this bus signal.

Remove Bus Elements from Starting Points

Figure showing the steps to remove the bus elements from starting point.

Version History

Introduced in R2015b