Hi,
I am making a graph and the below command is not writing a fraction, when the frac is used:
title('Q \geq frac{I_h H}{I_h H+I_z C}, b_1 \geq b_2');
The entire code is :
set(0,'DefaultAxesFontSize',10)
time=140;
Ct0=0.86; % Initial efficacy of Deltamethrin
N1= 810;
Ih= 0.4;
Iz= 2;
b1=-0.026; % indoor decay rate of insecticide
b2=-0.026; % outdoor decay rate of insecticide
Q= 0.2554;
H= 9.23675;
C= 5.39289;
for t=1:time
BCRh(t+1)= [(Q*Ct0)/(N1*Ih*1000000*H)] * exp(b1*t);
BCRz(t+1) = [((1-Q)*Ct0)/(N1*Iz*1000000*C)] * exp(b2*t);
end
figure('Color',[1 1 1]);
figure(1)
plot([0:1:time],BCRh,'g-', [0:1:time],BCRz,'k:','LineWidth',2);
xlabel('\tau');
title('Q \geq frac{I_h H}{I_h H+I_z C}, b_1 \geq b_2');
legend('BCR_h(\tau) ','BCR_z(\tau)');
clear all
Can someone please help me, on how to print a fraction in the title. Have I not used the correct latex syntax?
Thanks,
KKG.

댓글 수: 2

hamed shorakaei
hamed shorakaei 2017년 10월 6일
This is my question, too, but it seems, there is no way to write a fraction in Matlab.
Walter Roberson
Walter Roberson 2017년 10월 6일
? Wayne's answer works fine: use LaTex mode.
Using 'tex' mode might be more difficult.

댓글을 달려면 로그인하십시오.

 채택된 답변

Wayne King
Wayne King 2012년 6월 30일

4 개 추천

Hi, You should use the LaTex interpreter.
figure;
title('$$Q \geq \frac{I_h H}{I_h H+I_z C}, b_1 \geq b_2$$','interpreter','latex')

추가 답변 (1개)

Yash
Yash 2012년 6월 30일

0 개 추천

which latex editor are u using, wju dont you try mathType and then convert the equation already to latex, its very easy i write equation in word and then convert to tex file

카테고리

도움말 센터File Exchange에서 Mathematics에 대해 자세히 알아보기

제품

태그

질문:

2012년 6월 30일

댓글:

2017년 10월 6일

Community Treasure Hunt

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

Start Hunting!

Translated by