You need to do element-wise operations (particularly multiplication) in your code. See Array vs. Matrix Operations for the details.
If I understand your code correctly, this will work:
r = @(t) [t .* cos(t); t .* sin(t); ((2 * sqrt(2)) / 3) * t*3/2];
t = linspace(0, 2*pi, 250);
rt = r(t);
figure(1)
plot3(rt(1,:), rt(2,:), rt(3,:))
grid on
xlabel('i')
ylabel('j')
zlabel('k')
Note that the anonymous function ‘r’ creates a (3xN) matrix where the first row corresponds to ‘i’, the second to ‘j’ and the third to ‘k’, so ‘t’ must always be a row vector for the row indexing to work correctly.
