Color Text Output Using the 'publish' Function

조회 수: 6 (최근 30일)
Jeremy
Jeremy 2020년 6월 17일
댓글: soong 2023년 11월 7일
Good morning. Here's a question regarding the use of MATLAB's 'publish' function:
My goal is to make a couple of lines of text output as red letters. I can make it happen on the command window using the following line:
fprintf(2,'\nTEXT\n');
The issue at hand is that it does not output as such on the HTML document created using the 'publish' function, which is strange because so far everything has output as intended. During the course of researching the question, I came across 'cprintf' which, while wildly popular and seemingly useful, just won't work on my machine for whatever reason. The method above works just fine, though, because all I need is red. Thank you all very much in advance for your insight!
  댓글 수: 1
soong
soong 2023년 11월 7일
This output of red text is only suitable for fprintf to output what you think is an error message. Of course, if it is only used for red flags, this is enough

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

채택된 답변

Anmol Dhiman
Anmol Dhiman 2020년 6월 25일
Hi Jeremy,
I am assuming that you are publishing it as an HTML document. So you can use html tag in your document. Add the font color command inside the html tag. I hope when you are publishing, this will resolve the issue.
Regards,
Anmol Dhiman
  댓글 수: 1
Jeremy
Jeremy 2020년 6월 25일
Thank you very much, Anmol! I don't know much about HTML, but I found MATLAB's help page and an additional resource that should do the trick. Take care and have a great day!

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 MATLAB에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by