Rotate function

The function Rotatefxn3D is a numerical analogy of the Maple rotating function Rotate
87 Downloads
Updated 10 Nov 2015

View License

% 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
Created with R2012b
Compatible with any release
Platform Compatibility
Windows macOS Linux
Categories
Find more on Lighting, Transparency, and Shading in Help Center and MATLAB Answers
Tags Add Tags

Community Treasure Hunt

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

Start Hunting!
Version Published Release Notes
1.0.0.0