I have a variable in the workspace Bus type

조회 수: 4 (최근 30일)
Fernando  Beltrán
Fernando Beltrán 2016년 9월 20일
답변: BhaTTa 2024년 8월 27일
Goodnight, I have a doubt. I have a variable in the workspace Bus type called "out1" which is formed by three signals. I would like to access each of the variables from Matlab, but not the command that I use. Could anyone help me? Thank you very much

답변 (1개)

BhaTTa
BhaTTa 2024년 8월 27일
If you have a bus object in MATLAB called out1 that contains multiple signals, you can access each of the signals using dot notation. Here’s a step-by-step guide on how to do this:Accessing Signals from a Bus
  1. Ensure the Bus Object is Loaded: Before accessing the signals, make sure that the bus object out1 is loaded in the workspace. If it's part of a Simulink model, run the simulation or load the data into the workspace.
  2. Accessing Signals: If out1 is a bus object, you can access its signals using dot notation. Here's how you can do it:
% Assuming 'out1' is your bus object
signal1 = out1.signalName1;
signal2 = out1.signalName2;
signal3 = out1.signalName3;
Replace signalName1, signalName2, and signalName3 with the actual names of the signals within the bus.
Please refer to below documentation for working with a Simulink.Bus object:

카테고리

Help CenterFile Exchange에서 Sources에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by