fsurf: interval from parameters

5 ビュー (過去 30 日間)
Danny Van Elsen
Danny Van Elsen 2020 年 4 月 10 日
コメント済み: darova 2020 年 4 月 10 日
hello. when plotting this surface
syms u v
x = u;
y = v;
z = 4 - u^2 - v^2;
%fsurf(x, y, z, [-4 4 -4 4])
fsurf(x, y, z)
I was wondering if there is a way to specify the interval in terms of the u and v parameters?
for example, when u^2 + v^2 must be <= 4, something like
fsurf(x, y, z, [ u^2 + v^2 <= 4])
regards, Danny.

採用された回答

darova
darova 2020 年 4 月 10 日
If i plot something round i usually use polar coordinates
t = linspace(0,2*pi,30); % angle array
r = 0:5; % radius array
[T,R] = meshgrid(t,r); % create grid
z = 4 - R.^2;
[x,y] = pol2cart(T,R); % convert to cartesian
surf(x, y, z)
  2 件のコメント
Danny Van Elsen
Danny Van Elsen 2020 年 4 月 10 日
ok, thank you for this workaround.
but does this mean that the original question is impossible?
something like
fsurf(x, y, z, [ u^2 + v^2 <= 4])
?
darova
darova 2020 年 4 月 10 日
I think it's impossible

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

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

製品


リリース

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by