Plotting the parametrised intersection of two surfaces

2 ビュー (過去 30 日間)
Kayvan Gharbi
Kayvan Gharbi 2018 年 1 月 16 日
回答済み: Pawel Jastrzebski 2018 年 1 月 16 日
Am trying to plot the line x=2, y=-t, z=4+t^2 from -2<t<1. I am attempting to use the plot3 command to plot a 3D paramtrised line, yet the issue arises in the t^2 term as t is a row matrix of t inputs between -2 and 1 and cannot simply be 'squared.'Is there a way I can plot this line? The line was originally defined as the intersection between z=x^2 +y^2 and x=2 if there is alternative method plotting the surfaces?
Thanks

回答 (1 件)

Pawel Jastrzebski
Pawel Jastrzebski 2018 年 1 月 16 日
clear all;
clc;
t = linspace(-2,1,50);
x = zeros(size(t));
x(:) = 2;
y = -t;
z = 4+(t.^2);
plot3(x,y,z,'r')
grid on
xlabel('x');
ylabel('y');
zlabel('t');

カテゴリ

Help Center および File ExchangeSurface and Mesh Plots についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by