Working on a function that takes a vector input and runs it through a piecewise and returns a vector of output values, getting this error when running it.
for i = 0:length(x) if x(i)<0 y(i) = sind(x(i)); elseif 0<=x(i) && x(i)<=1 y(i)=x(i).^(1/2); elseif 1<x(i) && x(i)<x(6) y(i) = 1./factorial(floor(x(i))); elseif x(i)>=6 y(i) = 200*log(x(i)); endend
Best Answer