필터 지우기
필터 지우기

No appropriate method, property, or field who for class Simulink.S​imulationD​ata.Datase​t. How to access object or signal variable of class Simulink.S​imulationD​ata.Datase​t class

조회 수: 59 (최근 30일)
No appropriate method, property, or field who for class Simulink.SimulationData.Dataset. How to access object or signal variable of class Simulink.SimulationData.Dataset class - MATLAB 2017a and M2014a issue

답변 (2개)

Marcelo
Marcelo 2020년 2월 7일
About this class, Matlab itself gives the following info:
Simulink.SimulationData.Dataset
Package: Simulink.SimulationData
Characteristics:
Name: 'yout'
Total Elements: 1
Elements:
1 : ''
-Use get or getElement to access elements by index or name.
-Use addElement or setElement to add or modify elements.
Methods, Superclasses
Methods for class Simulink.SimulationData.Dataset:
Dataset concat get getElementNames removeElement
addElement find getElement numElements setElement
So, you can use something like this to get the signals from inside the Dataset element:
>> yout.get(1)
ans =
Simulink.SimulationData.Signal
Package: Simulink.SimulationData
Properties:
Name: ''
PropagatedName: ''
BlockPath: [1x1 Simulink.SimulationData.BlockPath]
PortType: 'inport'
PortIndex: 1
Values: [1x1 timeseries]
Methods, Superclasses
>> yout.get(1).Values
timeseries
Common Properties:
Name: ''
Time: [11x1 double]
TimeInfo: [1x1 tsdata.timemetadata]
Data: [11x1 double]
DataInfo: [1x1 tsdata.datametadata]
More properties, Methods
>> yout.get(1).Values.Data'
ans =
1 1 1 1 1 1 1 1 1 1 1
Or, if your signals have defined names, you can use them to get the signals directly. For example, if one of the signals is called "signal_1":
yout.getElement('signal_1').Values.Data

Sara Nadeau
Sara Nadeau 2020년 2월 7일
If you want to know the names of the elements in the object, you can use the getElementNames function.
If you want to access the data for a specific element, you can use the get or getElement functions. (The get and getElement functions have identical behavior, just a matter of how you want your code to read).
The get and getElement functions support accessing elements by their index within the Dataset object or by name. If you know the index of the element, you can also index into the Dataset object using curly braces. For example:
element1 = dsobj{1};
I hope this information and the linked pages for getElementNames and get help!

카테고리

Help CenterFile Exchange에서 Load Signal Data for Simulation에 대해 자세히 알아보기

태그

제품


릴리스

R2017a

Community Treasure Hunt

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

Start Hunting!

Translated by