Plotting 3D parametric surfaces

조회 수: 49 (최근 30일)
Alicia Sood
Alicia Sood 2020년 2월 28일
답변: Prabhan Purwar 2020년 3월 2일
I'm trying to plot the following surfaces on matlab but I'm unsure how to go about it, especially where some have unknown parameters like in (a) how there are the variables a and b.

답변 (1개)

Prabhan Purwar
Prabhan Purwar 2020년 3월 2일
Hi,
Variable a and b tends to be constants. Equation of ellipsoid as in your (a) part of the question is as follows:
x^2/a^2 + y^2/b^2 + z^2/c^2 = 1 .
Following code may help:
clc
close all
clear
a=1;
cb=2;
l=-3.14:0.1:3.14; %lemda
b=-3.14/2:0.1:3.14/2;
[X,Y]=meshgrid(l,b);
x=a.*cos(X).*cos(Y);
y=a.*sin(X).*cos(Y);
z=cb.*sin(Y);
r=surf(x,y,z);
Output:
Similarly other parts of the question can be solved.
Following links may help:

카테고리

Help CenterFile Exchange에서 Surface and Mesh Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by