MATLAB: Add 3 to the values of x that are even add a number to the values of x that are evenevenodd x=[7 6 1 2 0 -1 4 3 -2 0] how do I do this in smart short way? Best Answer Hi,x(find(mod(x,2) == 0)) = x(find(mod(x,2) == 0)) + 3orind = find(mod(x,2) == 0);x(ind) = x(ind) + 3; Related SolutionsMATLAB: Am obtaining errors while solving equations by fsolve See if:x0=[5,5,5,5,5]; x = fsolve(@myfun,x0);improves things. MATLAB: Simplify expression after collect function call vpa() on the expression. Related QuestionHelp on the function script??? Input argument “x” is undefined.How to expand polynomials with matlab
Best Answer