problem with Solid of revolution
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
sumana
am 20 Dez. 2016
Kommentiert: Star Strider
am 20 Dez. 2016
Hello,
I have a 2D function as shown in the curve below
, which I would like to revolve around x-axis using cylinder.
[X,Y,Z]=cylinder(y);
figure;surf(X,Y,Z);
xlabel('x');ylabel('y');zlabel('z');
So for the generated solid, x range should be 24-122 and both y and z axis range should be 0-~40. But I an getting something like the below solid.
I don't get why both x and y- axis ranges are the same and why z is varying from 0-1. What am I doing wrong? Ideally I should get an oval shaped solid and no sharp peak.
Thank you for the help.
0 Kommentare
Akzeptierte Antwort
Star Strider
am 20 Dez. 2016
That’s the default behaviour of the cylinder function. Use the rotate function to tip your customised cylinder on its side, and oriented in the direction you want.
5 Kommentare
Star Strider
am 20 Dez. 2016
My pleasure.
The axis aspect ratio controls how the plot looks. See the documentation for the axis function for details. Setting them to square or equal will change the appearance of the plot.
You can rotate the cylinder using any combination of the axes in the vector and at any angle.
If my Answer helped solve your problem, please Accept it.
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Surface and Mesh Plots finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!