Struct contents reference from a non-struct array object in yout.getElement

2 次查看(过去 30 天)
sim('pmu_3ph.slx');
vsignal= yout.getElement('VC_line');
t= vsignal.Values.Time;
v= vsignal.Values.Data;
ERROR:
Struct contents reference from a non-struct array object.
Error in LMSFunda (line 19) vsignal= yout.getElement('VC_line');
VC_line is a sinusoidal wave generated in my simulink model and it is attached to Out1 sink which i am trying to import to my program.
In workspace yout is 7254x1 double.
Please help me why this problem is coming and what can be done.

采纳的回答

Fangjun Jiang
Fangjun Jiang 2020-3-25
Like you said, In workspace yout is 7254x1 double, so you can't do vsignal= yout.getElement('VC_line');
You probably mixed up with the other commonly used variable "out" which is the default name for "single simulation output" and its format is "Dataset". Then you can use the method "getElement".

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Simulink Environment Customization 的更多信息

产品


版本

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by