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 个评论
Pavan Guntha
2021-11-17
Can you post the snapshots of warnings and attach the simulink model so that it would be helpful to debug?
回答(1 个)
Walter Roberson
2021-11-17
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 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!