フィルターのクリア

Plot a function of three variable

152 ビュー (過去 30 日間)
Md Borhan Mia
Md Borhan Mia 2019 年 1 月 16 日
コメント済み: VBBV 2023 年 4 月 12 日
Hey, I want to plot a function of three variables. Consider that I have a function like f(x,y,z)=x^2+y^2+z^2-3xyz, I want a surface plot of this function. How can I do that? Thanks!

回答 (1 件)

KSSV
KSSV 2019 年 1 月 16 日
f = @(x,y,z) x.^2+y.^2+z.^2-3*x.*y.*z ;
x = linspace(-1,1) ;
y = linspace(-1,1) ;
z = linspace(-1,1) ;
[X,Y,Z] = ndgrid(x,y,z) ;
F =f(X,Y,Z) ;
figure
hold on
for i = 1:100
surf(X(:,:,i),Y(:,:,i),Z(:,:,i),F(:,:,i)) ;
end
  3 件のコメント
Shubham
Shubham 2020 年 11 月 17 日
syms X Y Z
f = @(x,y,z) x^2 + y^2 + z^2;
surff = f(X,Y,Z);
fimplicit3(surff)
VBBV
VBBV 2023 年 4 月 12 日
@Md Borhan Mia you can use view to visualize a 3D plot
f = @(x,y,z) x.^2+y.^2+z.^2-3*x.*y.*z ;
x = linspace(-1,1) ;
y = linspace(-1,1) ;
z = linspace(-1,1) ;
[X,Y,Z] = ndgrid(x,y,z) ;
F =f(X,Y,Z) ;
figure
hold on
for i = 1:100
surf(X(:,:,i),Y(:,:,i),Z(:,:,i),F(:,:,i)) ;
end
view(45,45)

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

カテゴリ

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

タグ

製品


リリース

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by