Borrar filtros
Borrar filtros

I have a variable in the workspace Bus type

6 visualizaciones (últimos 30 días)
Fernando  Beltrán
Fernando Beltrán el 20 de Sept. de 2016
Respondida: BhaTTa el 27 de Ag. de 2024 a las 3:53
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

Respuestas (1)

BhaTTa
BhaTTa el 27 de Ag. de 2024 a las 3:53
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:

Categorías

Más información sobre Language Fundamentals en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by