フィルターのクリア

Plot the part of the cylinder x^2 + z^2 = 1 for y ≥ 0 , 0 ≤ z ≤ − y^2 + 1 . Can someone help me

10 ビュー (過去 30 日間)
dang thai bao
dang thai bao 2021 年 5 月 11 日
回答済み: DGM 2021 年 5 月 11 日
i don't know how to do it

回答 (1 件)

DGM
DGM 2021 年 5 月 11 日
This is a rather simple approach:
n = 200;
th = linspace(0,pi,n);
x = linspace(-1,1,n);
y = linspace(0,1,n).';
zc = repmat(sin(th),[n 1]);
xc = cos(th);
zp = repmat(-y.^2+1,[1 n]);
zc(zc>zp) = NaN;
surf(xc,y,zc); hold on
shading flat
axis equal
If you want to be assured that the trimmed face follows a parabola:
n = 200;
th = linspace(0,pi,n);
x = linspace(-1,1,n);
y = linspace(0,1,n).';
zc = repmat(sin(th),[n 1]);
xc = cos(th);
zp = repmat(-y.^2+1,[1 n]);
zc(zc>zp) = NaN;
surf(xc,y,zc); hold on
surf(x,y,zp,'facealpha',0.4);
shading flat
axis equal

カテゴリ

Help Center および File ExchangeSurface and Mesh Plots についてさらに検索

製品


リリース

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by