Info
This question is closed. Reopen it to edit or answer.
I am trying to write some equations in the plot in MATLAB but, i am getting error and it's not working.
1 view (last 30 days)
Show older comments
I am trying interpret equations using Latex. Here's my code and the figure attached.
z= 0:0.01:6
q=0.5*erfc(z./sqrt(2))
u=(1./((sqrt(2*pi)).*z)).*exp((-z.*z)./2)
semilogy(z,q,'color','k','LineWidth',2);
hold on;
semilogy(z,u,'--');
axis([0,6,10^(-8),1])
xlabel('z \rightarrow ' );
ylabel('Overbound approximation not applicable for small z');
title('The function Q(z) and an overbound')
str=strcat(' Q(z) \downarrow')
str1= strcat('downarrow','$${{\frac{(1)}{\sqrt{2\pi}}{{\frac{\exp{(-z)^2}}(2)}$$')
text(65,85,str);
text(1,0.6,str1,'Interpreter','Latex','FontSize',14);
Here is my error: str =
Q(z) \downarrow
str1 =
downarrow$${{\frac{(1)}{\sqrt{2\pi}}{{\frac{\exp{(-z)^2}}(2)}$$
Warning: Unable to interpret LaTeX string "downarrow$${{\frac{(1)}{\sqrt{2\pi}}{{\frac{\exp{(-z)^2}}(2)}$$" >>

Attached is the picture of the plot. i.e how it should look like.
0 Comments
Answers (1)
Walter Roberson
on 1 Feb 2018
Edited: Walter Roberson
on 1 Feb 2018
You are missing several } in str1
And remember the \ before the downarrow
0 Comments
This question is closed.
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!