Delimitation of cylinder function

2 次查看(过去 30 天)
I'm trying to do the revolution solid of a seccionated function as the following
And im using the following script
clc, clear all, close all
x = 1.983:0.1:10;
figure
[X,Y,Z] = cylinder(1/2*sin(25/68*x-2.3)+4.25,20);
surf(Z,X,Y)
xlabel('x'); ylabel('z'); zlabel('y')
hold on
[X,Y,Z] = cylinder(1/2*sin(25/68*x-2.3)+3.97,20);
surf(Z,X,Y)
The problem is that it appears that the cylinder function restricts the vectors to the scope of 0 to 1. And i'm trying that the sine functions appears from 1.9 to 10 and it appears from 0 to 1. This is the result that I get.

回答(1 个)

darova
darova 2020-3-9
You can build the surface manually (without using cylinder)
x = 1.983:0.1:10;
r = 1/2*sin(25/68*x-2.3)+4.25;
t = linspace(0,2*pi,20);
[T,X] = meshgrid(t,x);
[~,R] = meshgrid(t,r);
[Y,Z] = pol2cart(T,R);
surf(X,Y,Z)

类别

Help CenterFile Exchange 中查找有关 Line Plots 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by