Need help with the assignment from uni

1 visualización (últimos 30 días)
Tuan
Tuan el 22 de Mzo. de 2023
Comentada: Tuan el 23 de Mzo. de 2023
I have a question to draw a 3D cup of coffe (no need to draw a handle), I dont have any idea and knowledge yet to draw a specific object in matlab, can anyone help me with this please, many thanks.

Respuestas (1)

Sulaymon Eshkabilov
Sulaymon Eshkabilov el 22 de Mzo. de 2023
Editada: Sulaymon Eshkabilov el 22 de Mzo. de 2023
You can try using fsurf() to get a cup like shape - see this DOC:
R1 = 7.3/2;
R2 = 5.5/2;
T = asin(R2/R1);
X = @(x,y) R1*cos(x).*sin(y);
Y = @(x,y) R1*sin(x).*sin(y);
Z = @(x,y) -R1*cos(y);
fsurf(X,Y,Z,[0 2*pi 0 T], 'EdgeColor','none')
colormap parula
axis off
  2 comentarios
Tuan
Tuan el 22 de Mzo. de 2023
thanks for the help, but can you plot the inner surface of the cup too? any idea, cause iam so confuse with all the tutorial online
Tuan
Tuan el 23 de Mzo. de 2023
Hi , i just saw that you edit the code but nothing change, is there anything wrong

Iniciar sesión para comentar.

Categorías

Más información sobre Surface and Mesh Plots en Help Center y File Exchange.

Productos


Versión

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by