How can I plot two 2D figures simultaneously, with one orthogonal to the other? They both share the same t axis, but the x axis lies perpendicular to the z axis and t axis, and they all share the same zero point.

3 vues (au cours des 30 derniers jours)
t = 0:.1:20;
x = 2*(18./(.5*t+.5).^.5 - 5.5);
z = 18./(.5*t+.5).^.5 - 5.5;
figure(1)
plot(t,x,':')
xlabel('Time')
ylabel('Distance')
set(gcf,'color','w')
figure(2)
plot(t,z,':')
xlabel('Time')
ylabel('Sink Rate')
set(gcf,'color','w')
axis([-inf inf -20 20])

Réponse acceptée

Kelly Kearney
Kelly Kearney le 9 Oct 2015
Do you mean you want a 3D axis?
t = 0:.1:20;
x = 2*(18./(.5*t+.5).^.5 - 5.5);
z = 18./(.5*t+.5).^.5 - 5.5;
figure;
plot3(t, x, zeros(size(t)));
hold on
plot3(t, zeros(size(t)), z);
xlabel('Time');
ylabel('Distance');
zlabel('Sink Rate');
grid on;
set(gca, 'ydir', 'reverse');
  2 commentaires
edward bachelder
edward bachelder le 9 Oct 2015
I'd like the graph to look similar to what is shown in the attached file
edward bachelder
edward bachelder le 9 Oct 2015
Using the view(az,el) I rotated your solution to what I needed. Thanks very much Kelly!

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Line Plots dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by