Integrating and graphing in 3

Hello, I am fairly new to matlab, but it would be a great help if someone could answer the following question. I would like to revolve a function around the x axis and then graph it in 3D using matlab. The function is as follows:
f(x)= (((6.4)/(x+12))*sin((2pi)/6.5x)+3)
The function to revolve it around the x-axis, I believe is:
V=pi[f(x)]^2 dx
The domain I wish to graph it between is:
0x16
I know, that using the cylinder function, it can be revolved but I am unsure as to how to first integrate this function using the above formula, then graph it in 3D in between the desired domain. That is somehow, involving x,y,z.
Help would be great to somehow integrate the function using the V formula, then using the cylinder function, graph it in 3D between the domain.
Thanks!

Answers (1)

You can integrate it with the Symbolic Math Toolbox.
The plot is not very interesting:
syms x
f(x) = (((6.4)/(x+12))*sin((2*pi)/6.5*x)+3);
intf(x) = int(f, x);
intf(x) = simplify(intf, 'Steps', 20);
f_int = matlabFunction(intf)
figure(1)
fplot(intf, [0 16])
Anonymous function:
f_int = @(x)x.*3.0-exp(pi.*3.076923076923077e-1i).*ei(pi.*(x+1.2e1).*3.076923076923077e-1i).*3.2i+exp(pi.*1.923076923076923e-1i).*ei(pi.*(x+1.2e1).*-3.076923076923077e-1i).*(1.6e1./5.0)

Categories

Find more on MATLAB in Help Center and File Exchange

Asked:

on 5 Aug 2017

Answered:

on 5 Aug 2017

Community Treasure Hunt

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

Start Hunting!