I'm trying to take a vector as an input for a function and change all the negative values of the vector into 0's, then output the new vector.
function newX = valu(x) for x if (x<0) x = x .* 2; end newX = x; endend
How would I tell Mathlab that X is a vector that will be assigned by the user (when calling the function)?
Best Answer