how do I insert a string var in title command using LaTeX/TeX

조회 수: 3 (최근 30일)
Jan
Jan 2014년 6월 18일
편집: Walter Roberson 2016년 4월 14일
Greetings,
I've been looking for a solution for the following challenge:
figure(1)
title ('\color{cyan}\WBC \color{red}RBC \color{blue}PLT)
displays "WBC RBC PLT" above the plot in fig(1) in the selected colors.
Now I'd like to add the number of events for the 3 subsets in the figure(2) title, but have not been able to figure out how to replace the 'literal' strings WBC, RBC, and PLT with string variables as in
wbcstr = num2str(100);
rgbstr = num2str(1000);
pltstr = num2str(60);
figure(2)
title ('\color{cyan}\wbcstr \color{red}rbcstr \color{blue}rbcstr)
Thanks in advance,
Jan

채택된 답변

Kevin Claytor
Kevin Claytor 2014년 6월 18일
mytitle = sprintf('\\color{red}%d \\color{blue}%f',5,pi);
title(mytitle)

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Migrate GUIDE Apps에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by