Info

この質問は閉じられています。 編集または回答するには再度開いてください。

I am trying to write some equations in the plot in MATLAB but, i am getting error and it's not working.

1 回表示 (過去 30 日間)
Sam17
Sam17 2018 年 2 月 1 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
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.

回答 (1 件)

Walter Roberson
Walter Roberson 2018 年 2 月 1 日
編集済み: Walter Roberson 2018 年 2 月 1 日
You are missing several } in str1
And remember the \ before the downarrow

この質問は閉じられています。

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by