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

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".

댓글 수: 2

what else can be used instead of Out to get a signal then?
In Simulation Configuration Parameters, Data Import/Export, set the variable name and format.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Simulink에 대해 자세히 알아보기

제품

릴리스

R2017b

질문:

2020년 3월 25일

댓글:

2020년 3월 25일

Community Treasure Hunt

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

Start Hunting!

Translated by