フィルターのクリア

How does matlab draw the following image?

2 ビュー (過去 30 日間)
ma Jack
ma Jack 2022 年 7 月 18 日
コメント済み: ma Jack 2022 年 7 月 24 日
Note that the basic geometric elements inside are spheres, cones and small cylinders, and that the known data are the 3D positions of the spheres [x1,y1,z1] and the 3D vectors of the arrows on each small ball [x2,y2,z2], which seems difficult
  3 件のコメント
Adam Danz
Adam Danz 2022 年 7 月 18 日
Currently there is no 3D quiver function that produces those types of objects. There may be a file in the file exchange that comes close, for example: arrow3. Alternatively, you could produce a 3D quiver using the functions you described (sphere, and cylinder for the arrow and bars). If you go that route, I would make a function that creates 3D quiver arrows given a vector of direction and a vector of magnitudes.
ma Jack
ma Jack 2022 年 7 月 24 日
Yes, I need a simple example code please, plus this is not homework.

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

採用された回答

Chunru
Chunru 2022 年 7 月 24 日
clf
ax = axes;
hold on
view(3)
grid on
% The arrows (vertical)
[xs, ys, zs] = sphere(50);
[xc, yc, zc] = cylinder(0.5, 50);
[xa, ya, za] = cylinder([1 0], 50);
h(1) = surface(0.7*xs, 0.7*ys, zs, 'EdgeColor','none');
h(2) = surface(xc, yc, 5*zc, 'EdgeColor','none');
h(3) = surface(xa, ya, 2*za+5, 'EdgeColor','none');
t = hgtransform('Parent',ax);
set(h,'Parent',t)
% Make transform: rotate, translate, scaling and so on
Ry = makehgtform('yrotate',20);
% Scaling matrix
Sxy = makehgtform('scale', 2);
% Concatenate the transforms and
% set the transform Matrix property
set(t,'Matrix',Ry*Sxy)
colormap(gray(256));
axis equal
material metal
  1 件のコメント
ma Jack
ma Jack 2022 年 7 月 24 日
Thank you very much sir, it was very enlightening

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeVector Fields についてさらに検索

製品


リリース

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by