How do I plot x^2+z^2=9 above the xy plane and between y=-1 and y=2?
25 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Carter Pennington
am 3 Dez. 2018
Beantwortet: Carlos Guerrero García
am 29 Nov. 2022
syms x y z;
[x,y,z]=meshgrid(-10:1:10);
Z = realsqrt(9-x^2);
surf(X,Y,Z);
0 Kommentare
Akzeptierte Antwort
Aoi Midori
am 3 Dez. 2018
How about:
syms x y z;
[x,y]=meshgrid(-10:1:10);
z = abs(sqrt(9-x.^2));
surf(x,y,z);
ylim([-1 2])
1 Kommentar
Weitere Antworten (2)
min many
am 18 Feb. 2022
syms x y z;
[x,y]=meshgrid(-10:1:10);
z = abs(sqrt(9-x.^2));
surf(x,y,z);
ylim([-1 2])
0 Kommentare
Carlos Guerrero García
am 29 Nov. 2022
The z definition z=sqrt(9-x^2) is not for the below part of the surface. I prefer not using symbolic variables for the representation. I suggest the following lines:
[t,y]=meshgrid(0:pi/60:2*pi,-1:0.1:2); % 't' for a parametrization of x^2+z^2=9. The 'y' range as the statement
x=3*cos(t);
z=3*sin(t); % The 'x' and 'z' parametrization of x^2+z^2=9
surf(x,y,z); % Plotting the surface
axis equal; % ..with equal ratios
set(gca,'BoxStyle','full'); % Establishing the option 'full' for a bounding box
box % Adding a bounding box
0 Kommentare
Siehe auch
Kategorien
Mehr zu Formula Manipulation and Simplification finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!