This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

remsignal (hostScope,signal)

Remove signals from host scope represented by scope object

Syntax

scope_object_vector = remsignal(scope_object_vector)
scope_object_vector = remsignal(scope_object_vector, signal_index_vector)

Description

scope_object_vector = remsignal(scope_object_vector) removes all signals from one or more scope objects. Before you can remove a signal from a scope, you must stop the scope.

example

scope_object_vector = remsignal(scope_object_vector, signal_index_vector) removes one or more signals from one or more scope objects. Specify the signals by their indices, which you can retrieve by using the target object method getsignalid. If scope_object is a vector containing two or more scope objects, the same signals are removed from each scope.

At the target computer command line, you can remove multiple signals from the scope:

remsignal scope_index = signal_index1, signal_index2, . . .
signal_index is optional. If you do not include signal_index, all signals are removed.

Examples

collapse all

Remove all signals from scope 1. The model is xpcosc.

Get the object that represents scope 1.

tg = slrt;
sc1 = getscope(tg,1);

Remove all signals from the scope.

scope_object_vector = remsignal(sc1)
scope_object_vector = 

Simulink Real-Time Scope
   Application          = xpcosc
   ScopeId              = 1
   Status               = Interrupted
   Type                 = Host
   NumSamples           = 250
   NumPrePostSamples    = 0
   Decimation           = 1
   TriggerMode          = FreeRun
   TriggerSignal        = -1 
   TriggerLevel         = 0.000000
   TriggerSlope         = Either
   TriggerScope         = 1
   TriggerSample        = 0
   StartTime            = -1.000000
   Data                 = Matrix (250 x 0)
   Time                 = Matrix (250 x 1)
   Signals              = no Signals defined

Remove signals 'Integrator' and 'Signal Generator' from scopes 2 and 3.

Get the objects that represent scopes 2 and 3.

sc2 = getscope(tg, 2);
sc3 = getscope(tg, 3);

Get the signal indices that represent signals 'Integrator' and 'Signal Generator'.

s1 = getsignalid(tg,'Integrator');
s2 = getsignalid(tg,'Signal Generator');

Remove the signals.

scope_object_vector = remsignal([sc2 sc3], [s1 s2])
scope_object_vector = 

Simulink Real-Time Scope
   Application          = xpcosc
   ScopeId              = 2
   Status               = Interrupted
   Type                 = Host
   NumSamples           = 250
   NumPrePostSamples    = 0
   Decimation           = 1
   TriggerMode          = FreeRun
   TriggerSignal        = 3  : Integrator
   TriggerLevel         = 0.000000
   TriggerSlope         = Either
   TriggerScope         = 2
   TriggerSample        = 0
   StartTime            = -1.000000
   Data                 = Matrix (250 x 1)
   Time                 = Matrix (250 x 1)
   Signals              = 4  : Integrator1

Simulink Real-Time Scope
   Application          = xpcosc
   ScopeId              = 3
   Status               = Interrupted
   Type                 = Host
   NumSamples           = 250
   NumPrePostSamples    = 0
   Decimation           = 1
   TriggerMode          = FreeRun
   TriggerSignal        = 3  : Integrator
   TriggerLevel         = 0.000000
   TriggerSlope         = Either
   TriggerScope         = 3
   TriggerSample        = 0
   StartTime            = -1.000000
   Data                 = Matrix (250 x 1)
   Time                 = Matrix (250 x 1)
   Signals              = 4  : Integrator1

Input Arguments

collapse all

Get a scope object by calling the target object methods SimulinkRealTime.target.addscope or SimulinkRealTime.target.getscope.

Get a signal index by calling the target object method SimulinkRealTime.target.getsignalid.

Output Arguments

collapse all

This vector is the same as scope_object_vector, but with the changes that were made by the function call.

Introduced in R2014a