giving color to output result

조회 수: 6 (최근 30일)
Alperen Koyuncu
Alperen Koyuncu 2020년 6월 8일
답변: Tommy 2020년 6월 9일
hi guys,
can ı give color to results? I added the code I wrote below. The results of R1,R2,R3 should appear red and L1,L2,L3 should appear yellow. Is ıt possible to do that ?
alphav=input ('alphav girin');
alphac=input ('alphac girin');
L1=-alphav/2;
R1=(-alphav/2)+alphav;
L2=-(alphav/2)-alphac;
R2=(-alphav/2)-alphac+alphav;
L3=-(alphav/2)-(2*alphac);
R3=(-alphav/2)+alphav+alphav-(2*alphac);
if L1<0
L1=L1+720;
end
if L2<0
L2=L2+720;
end
if L3<0
L3=L3+720;
end
if R1<0
R1=R1+720;
end
if R2<0
R2=R2+720;
end
if R3<0
R3=R3+720;
end
L11=L1+360;
L22=L2+360;
L33=L3+360;
R11=R1+360;
R22=R2+360;
R33=R3+360;
if L11>720
L11=L11-720
end
if L22>720
L22=L22-720
end
if L33>720
L33=L33-720
end
if R11>720
R11=R11-720
end
if R22>720
R22=R22-720
end
if R33>720
R33=R33-720

답변 (1개)

Tommy
Tommy 2020년 6월 9일
If you mean output to the command window, see this file exchange contribution from Yair Altman:
Generally, if you want better control over the text which is printed to the command window, I would recommend using fprintf() or maybe disp() (or in this case cprintf()) rather than relying on display(), which is what you are doing by omitting semi-colons.

카테고리

Help CenterFile Exchange에서 Interactive Control and Callbacks에 대해 자세히 알아보기

제품


릴리스

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by