Rotate function
% The function Rotatefxn3D is a numerical analogy of the Maple rotating
% function Rotate. It generates the X,Yand z coodinates to be used by the
% surf function to generate the required surface, just like the matlab
% function cylinder does.
% fxn is the function to be rotated
% axis is the axis of rotation eg 'x','y','z'
% xbound is the range of values of x
% arcbound is the bound of angle of rotation
% Nx is the number of step in x direction
% Na is the number of angular steps
Eample1:
[X,Y,Z] = Rotatefxn3D(@(t) sin(t),'x',[0,10],40,[0,2*pi],20);
s = surf(X,Y,Z); set(s,'FaceColor','r'); axis equal
camlight
lighting gouraud
title('Rotatefxn3D(@(t) sin(t),''x'',[0,10],40,[0,2*pi],20)')
Example2:
[X,Y,Z] = Rotatefxn3D(@(t) sin(t),'z',[0,10],20,[0,2*pi],40);
s = surf(X,Y,Z); set(s,'FaceColor','r'); axis equal
camlight
lighting gouraud
title('Rotatefxn3D(@(t) sin(t),''z'',[0,10],20,[0,2*pi],40)')
Cite As
Lateef Adewale Kareem (2024). Rotate function (https://www.mathworks.com/matlabcentral/fileexchange/53908-rotate-function), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Platform Compatibility
Windows macOS LinuxCategories
- MATLAB > Graphics > Formatting and Annotation > 3-D Scene Control > Lighting, Transparency, and Shading >
Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
Version | Published | Release Notes | |
---|---|---|---|
1.0.0.0 |