Plotting 3d phase space using Simulink and Matlab
显示 更早的评论
Hello, and thanks for your help.
I have made a simulink simulation that outputs 3 state variables (x1,x2,x3) like this:

I need to plot the evolution of said state variables in a 3d phase plot inside Simulink, the graph doesn't have to update in real time, it's fine if it appears after the simulation is complete.
As you can see, I tried using a matlab block that contains the following code:
function plot3d(x1,x2,x3)
hold on;
grid on;
plot3(x1,x2,x3);
However, this code outputs nothing, what's even worse, once the simulation is complete all I see is a blank 2d graph. I'd like to know whether there's some Simulink function that allows me to do what I want (I could find none so far), or how I can improve my code to achieve the desired output.
Thank you.
回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Simulink 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!