I have an error while plotting
显示 更早的评论
I have the following code (It's a differential equation)
function conv = h4_5(t,q)
a=8/3;
b=28;
c=10;
x=q(1);
y=q(2);
z=q(3);
conv=zeros(3,1);
conv(1)=c*(y-x);
conv(2)=x*(b-z)-y;
conv(3)=x*y-a*z;
end
but when I'm trying to solve and plot it with
[t,q]=ode45('h4_5',[0 200],[0 1 0]);
plot3(q(1),q(2),q(3),'b')
view(-10,10)
xlabel('x')
ylabel('y')
zlabel('z')
all I get is an empty graph. No errors or something, just an empty graph. The goal of this exercise is plotting convection in the atmosphere with aid of the three given differential equations (displayed in first part of code behind conv(1), 2 and 3. I hope someone knows how to fix this.
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 2-D and 3-D Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!