Plotting the parametrised intersection of two surfaces

2 views (last 30 days)
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

Answers (1)

Pawel Jastrzebski
Pawel Jastrzebski on 16 Jan 2018
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');

Tags

Community Treasure Hunt

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

Start Hunting!