MATLAB: Solve equation by numerical method

equationfzeroMATLABsolve

i need to solve this hideous equation.
2*x3+(2^(1/2)*exp(-x3^2/2) + 2^(1/2))/(pi^(1/2)*erf((2^(1/2)*x3)/2))+(2^(1/2)*exp(-x3^2/2))/(pi^(1/2)*(erf((2^(1/2)*x3)/2) - 1))=0
my_function = @(x3) 2*x3+(2^(1/2)*exp(-x3^2/2) + 2^(1/2))/(pi^(1/2)*erf((2^(1/2)*x3)/2))+(2^(1/2)*exp(-x3^2/2))/(pi^(1/2)*(erf((2^(1/2)*x3)/2) - 1))==0;
z = solve(my_function)
when i compile this, it says "Empty sym: 0-by-1" i don't think the answer can be found. I tried the fpsolve, fzero functions too but none were effective. How do i find the root for that equation? Thank you

Best Answer

Always try to plot() something to see what you have...
>> fnf = @(x3) 2*x3+(2^(1/2)*exp(-x3^2/2) + 2^(1/2))/(pi^(1/2)*erf((2^(1/2)*x3)/2))+(2^(1/2)*exp(-x3^2/2))/(pi^(1/2)*(erf((2^(1/2)*x3)/2) - 1));
>> ezplot(fnf)
Warning: Function failed to evaluate on array inputs; vectorizing the function may speed up its evaluation and avoid
the need to loop over array elements.
> In ezplot>ezplot1 (line 498)
In ezplot (line 154)
>> ylim([-8 8])
>>
yields
which clearly shows there is no intersection of the zero line