Struct contents reference from a non-struct array object.
이전 댓글 표시
I need to make a function that showes me the state space model for a circuit and i need to overlap the simulink graph to the workspace one. I used this:
t=0:0.1:15;
u=(t>=0);
c=1;
L=1;
R=1;
x0=[0.59 1.71];
A=[0 1/c ; -1/L -R/L];
B=[0 ; 1/L];
C=[-1 -R];
D=[1];
sistem=ss(A,B,C,D);
[y,t,x]=lsim(sistem,u,t,x0);
figure;
plot(t,y); hold;
plot(ScopeData.time,ScopeData.signals.values,'x');
but for the last plot it said 'Struct contents reference from a non-struct array object.'
What's wrong?
댓글 수: 1
Stephen23
2018년 4월 1일
At first it worked, but when I came back to the program it said that error.
채택된 답변
추가 답변 (1개)
Eugen Gamentzy
2018년 4월 1일
0 개 추천
댓글 수: 1
Walter Roberson
2018년 4월 1일
If ScopeData were initialized as the empty array and later expected to be overwritten with the struct but was not overwritten then you could get that error. You should look at size() and class() of the variable.
카테고리
도움말 센터 및 File Exchange에서 Schedule Model Components에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!