3D image - how to delete some domain
Afficher commentaires plus anciens
Hello !
I have the question ,
I try to plot the graph , but I don't know how to erase those part of the graph that lies outside my domain , what should I do ?
Thank You !

Réponses (1)
The “fimplicit3” function is designed to plot 3-D implicit functions defined by “f(x, y, z) = 0” over specified intervals for “x” , “y”, and “z”. While it does not directly allow for plotting a cylinder between two planes (two functions), similar results can be achieved by using the following code:
r = 3; x0 = 3; y0 = 3;
% Angular range
theta = linspace(0, 2*pi, 100);
% x and y coordinates of the cylinder
x = x0 + r * cos(theta);
y = y0 + r * sin(theta);
% z range
z_min = zeros(size(theta));
z_max = 18 - x - y;
figure;
hold on;
%Plotting between the given limits
surf([x; x], [y; y], [z_min; z_max], 'FaceColor', [1 0.5 0]);
view(60, 20);
grid on;
axis equal;
hold off;
For more details, please consult the documentation for the functions utilized:
Hope this helps!
Catégories
En savoir plus sur Line Plots dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
