I will assume you have already plotted the curve described by your equation (an helix), by calculating "npo" points on the helix. The plot should be something like this:
Then use the following code:
hold on
for i=1:npo
v=[-R*sin(alpha(i)), R*cos(alpha(i)), h/(2*pi)];
v=v/norm(v);
b=[R*h/(2*pi)*sin(alpha(i)), -R*h/(2*pi)*cos(alpha(i)), R^2];
b=b/norm(b);
n=cross(b, v);
n=n/norm(n);
quiver3(x(i), y(i), z(i), v(1), v(2), v(3), 'r');
quiver3(x(i), y(i), z(i), b(1), b(2), b(3), 'b');
quiver3(x(i), y(i), z(i), n(1), n(2), n(3), 'g');
movie_frames(i)=getframe(gcf);
res=findobj(gca, 'Type', 'Quiver');
res(1).delete
res(2).delete
res(3).delete
end
To view the resulting video, call
Best Answer