Keep receiving warning sign "undefined variable" while using sim function and plotting graphs

In MATLAB
sys=tf(5,[10^-6,0,0.3]);
sim('Camdemo')
plot(tout,simout(:,1),tout,simout(:,2),'--')
below picture is SIMULINK Camdemo
I am keep receiving warnings even though I have simout and tout in my workspace.
I don't know the reason. Please help me

댓글 수: 1

Can you post the snapshots of warnings and attach the simulink model so that it would be helpful to debug?

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

답변 (1개)

You appear to have an object named out in your workspace, and the tout and simout properties of the object seem to be what you are looking for.
plot(out.tout, out.simout(:,1), out.tout, out.simout(:,2), '--')

카테고리

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

질문:

2021년 11월 8일

답변:

2021년 11월 17일

Community Treasure Hunt

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

Start Hunting!

Translated by