フィルターのクリア

How can I plot 3D surface x^3 + y^3 + z^3 = 1, where x, y, z are in unit closed interval in MATLAB ?.

6 ビュー (過去 30 日間)
I want to plot a surface x^3 + y^3 + z^3 = 1, where x, y, z are in unit closed interval. The MATLAB is not displaying the plot. Perhaps there occur some complex roots. Please help me to write its code. Thanks in advance.

採用された回答

madhan ravi
madhan ravi 2018 年 11 月 11 日
編集済み: madhan ravi 2018 年 11 月 11 日
syms x y z
fimplicit3(x^3+y^3+z^3==1,[-1 1 -1 1 -1 1])
  11 件のコメント
Bruno Luong
Bruno Luong 2018 年 11 月 11 日
編集済み: madhan ravi 2018 年 11 月 11 日
Thanks
madhan ravi's reply: Anytime :) @Bruno

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

その他の回答 (1 件)

Bruno Luong
Bruno Luong 2018 年 11 月 11 日
[x,y,z]=ndgrid(linspace(-1,1,33));
v=x.^3+y.^3+z.^3-1;
close all
p = patch(isosurface(x,y,z,v,0));
p.FaceColor = 'red';
daspect([1 1 1])
view(120,-30);
axis tight
camlight
lighting gouraud
  15 件のコメント
Torsten
Torsten 2022 年 7 月 26 日
Maybe you mean
x = linspace(0, 1,100 ).';
f = @(x) (x<0.5) .* (30.*x) + (x>=0.5).* (70.*x-20 );
g = @(x) (x<0.5).* (30.*(1-x)) + (x>=0.5).* (50-70.*x ) ;
figure
plot(x, [f(x), g(x)], 'linewidth', 1.5 )
Amna Habib
Amna Habib 2022 年 7 月 26 日
Yes, exactly. The same is required.
Thanks a lot @Torsten.

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

カテゴリ

Help Center および File ExchangeLighting, Transparency, and Shading についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by