![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/274631/image.jpeg)
Plotting 3D parametric surfaces
49 ビュー (過去 30 日間)
古いコメントを表示
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.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/274270/image.jpeg)
0 件のコメント
回答 (1 件)
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:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/274631/image.jpeg)
Similarly other parts of the question can be solved.
Following links may help:
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Surface and Mesh Plots についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!