MATLAB: How solve 1 unknown varible function

doublefsolvemathematicsMATLAB

hi, i am new at matlab and i am having troubles with fsolve.
>> fsolve('(2x+4)/(x+2)=5','x') ??? Error using ==> fsolve at 148 FSOLVE only accepts inputs of data type double.

Best Answer

fsolve(@(x) (2*x+4)/(x+2)-5,0)
And the equation you propose has no solution because x+2 simplifies away