主要内容

getAllSignals

R2026b

Get all signals in Simulink.sdi.Run object

Description

sigs = getAllSignals(runObj) returns an array of Simulink.sdi.Signal objects, sigs, that correspond to the signals contained in the Simulink.sdi.Run object runObj. Use the getAllSignals function when you need to work with many or all of the signals in the run. When you need to analyze a specific signal, you can access the single Signal object using the getSignalsByName function or the getSignalByIndex function.

example

Examples

collapse all

Get all signals in the Simulink.sdi.Run object myRunObj.

allSigs = getAllSigs(myRunObj);

Display the name and index of each signal in the run.

count = length(allSigs);
for idx = 1:count
    sig = allSigs(idx);
    name = sig.Name;
    formatSpec = "The signal at index %d is named %s.\n";
    fprintf(formatSpec,idx,name)
end
The signal at index 1 is named sineSig.
The signal at index 2 is named randSig.
The signal at index 3 is named chirpSig.

Input Arguments

collapse all

Run containing the signals you want to access, specified as a Simulink.sdi.Run object.

Output Arguments

collapse all

Signals contained in the run, returned as an array of Simulink.sdi.Signal objects.

Version History

Introduced in R2020a