フィルターのクリア

[X,Y,Z] = cylinder(r) function explanation

4 ビュー (過去 30 日間)
sgspark
sgspark 2017 年 8 月 9 日
回答済み: Manuel Cornejo Muñoz 2019 年 10 月 22 日
What does the [X,Y,Z]=cylinder(r) function do for a given variable r intuitively? The explanation on the function page isn't very clear, I'm not sure what they mean by a profile curve. And further, what would doing, say, mesh(X) produce?

採用された回答

John D'Errico
John D'Errico 2017 年 8 月 9 日
編集済み: John D'Errico 2017 年 8 月 9 日
Why not try it?
r = linspace(1,5,25);
[X,Y,Z]=cylinder(r);
surf(X,Y,Z)
I won't show you the plot, because you need to try these things! Look at what came out. Think about what went in. If you never try things in MATLAB you will never learn anything.
Now try the same test, but with
r = ones(10,1);
...
Does this look like a more traditional cylinder?
Now, what would you expect to see for this case:
r = sqrt(linspace(0,10,100));
...
Is there a name for that general class of surface? What do all of these surfaces tell you about the behavior of the cylinder function? Now go back and re-read the help.
  1 件のコメント
Vivek Puduri
Vivek Puduri 2019 年 10 月 15 日
this is great! I'm able to use this code to change the base and top radius, however how would I change the height of the cylinder past 1?

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

その他の回答 (1 件)

Manuel Cornejo Muñoz
Manuel Cornejo Muñoz 2019 年 10 月 22 日
But the example that provides Mathworks in Getting Started is not so obvious. Take a look at subplot z. You see:
t = 0:pi/10:2*pi;
[X,Y,Z] = cylinder(4*cos(t));
subplot(2,2,1); mesh(X); title('X');
subplot(2,2,2); mesh(Y); title('Y');
subplot(2,2,3); mesh(Z); title('Z');
subplot(2,2,4); mesh(X,Y,Z); title('X,Y,Z');

カテゴリ

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