= MATLAB Looping = MATLAB supports two '''looping''' constructs: `for` blocks and `while` blocks. <> ---- == For Blocks == Building off [[MATLAB/Quiver3|this example]]: {{{ syms t; % Position functions. x(t) = cos(t); y(t) = -sin(t); z(t) = t^2; % Tangent functions. xprime(t) = -sin(t); yprime(t) = -cos(t); zprime(t) = 2*t; figure; hold on; for i=1:length(times) quiver3(x(i),y(i),z(i), xprime(i),yprime(i),zprime(i)); end hold off; }}} ---- CategoryRicottone