Rotate function

version 1.0.0.0 (1.22 KB) by
The function Rotatefxn3D is a numerical analogy of the Maple rotating function Rotate

Updated 10 Nov 2015

% 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 (2022). 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