Im trying to write the equation f(x) = e^x + 2^-x +2cosx-6 in matlab code. I've tried the following and it gives me an error that points to cos.
f=@(x) exp(x)+2^(-x)+2cos(x)-6 gives Error: Unexpected MATLAB expression that points to cosx
cosineequation
Best Answer