
* Native engine as described in [[examples/matlab-and-org-mode/matlab-and-org-mode.org][matlab-and-org-mode.org]]
Start the matlab engine first then

#+begin_src matlab   :results output raw :exports results  :eval never-export 
al=1-0.99;
l=norminv(1-al/2,0,1);
n=53;
p0=15/53;
q0=1-15/53;
err=sqrt((p0*q0)/n);
ic=l*err;
disp('\begin{align*}')
fprintf('p_0&=\\frac{15}{53}=%g\\\\ \n',p0)
fprintf('\\lambda_p &=%g\\\\ \n',l)
fprintf('p_{0}&\\pm \\lambda_{1-\\frac{\\alpha }{2}}\\sqrt{\\frac{p_{0}(1-p_{0})}{n}}=% g \\pm %g\\cdot %g\\\\ \n',p0,l,err)
fprintf('p_{0}&\\pm \\lambda_{1-\\frac{\\alpha }{2}}\\sqrt{\\frac{p_{0}(1-p_{0})}{n}}=%g \\pm %g \n',p0,ic)
disp('\end{align*}')
#+end_src

#+RESULTS:
\begin{align*}
p_0&=\frac{15}{53}=0.283019\\
\lambda_p &=2.57583\\
p_{0}&\pm \lambda_{1-\frac{\alpha }{2}}\sqrt{\frac{p_{0}(1-p_{0})}{n}}= 0.283019 \pm 2.57583\cdot 0.0618762\\
p_{0}&\pm \lambda_{1-\frac{\alpha }{2}}\sqrt{\frac{p_{0}(1-p_{0})}{n}}=0.283019 \pm 0.159383
\end{align*}

# This is the same result as obtained by the python engine.
