フィルターのクリア

How to plot a function depending on 3 different vectors as mesh or surface

1 回表示 (過去 30 日間)
Hazim Nasir
Hazim Nasir 2018 年 8 月 7 日
コメント済み: Hazim Nasir 2018 年 8 月 7 日
hello How I can plot the function f as a mesh or surface thanks for any help
d = 0.1;
a = 0.7;
t1 = -20:1:20;
t2 = -20:1:20;
t3 = -20:1:20;
t4 = -20:1:20;
x = cosd(t1).*(d.* sind(t2+t3+t4)+a_2 .*cosd(t2)+a* cosd(t2+t3));
y = sind(t1).*(d.* sind(t2+t3+t4)+a_2 .*cosd(t2)+a.* cosd(t2+t3));
z = a.* sind(t2) - d.* cosd(t2+t3+t4) + a.* sind(t2+t3) ;
f = sqrt(x.^2 + y.^2 + z.^2);

採用された回答

KSSV
KSSV 2018 年 8 月 7 日
d = 0.1;
a = 0.7; a_2 = 0.9 ;
t1 = -20:1:20;
t2 = -20:1:20;
t3 = -20:1:20;
t4 = -20:1:20;
x = cosd(t1).*(d.* sind(t2+t3+t4)+a_2 .*cosd(t2)+a* cosd(t2+t3));
y = sind(t1).*(d.* sind(t2+t3+t4)+a_2 .*cosd(t2)+a.* cosd(t2+t3));
z = a.* sind(t2) - d.* cosd(t2+t3+t4) + a.* sind(t2+t3) ;
[X,Y,Z] = meshgrid(x,y,z) ;
% f = sqrt(x.^2 + y.^2 + z.^2);
F = sqrt(X.^2 + Y.^2 + Z.^2);
figure
hold on
for i = 1:41
surf(X(:,:,i),Y(:,:,i),Z(:,:,i),F(:,:,i))
end

その他の回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by