how can i change the colors of matrix rows ?
이 질문을 팔로우합니다.
- 팔로우하는 게시물 피드에서 업데이트를 확인할 수 있습니다.
- 정보 수신 기본 설정에 따라 이메일을 받을 수 있습니다.
오류 발생
페이지가 변경되었기 때문에 동작을 완료할 수 없습니다. 업데이트된 상태를 보려면 페이지를 다시 불러오십시오.
이전 댓글 표시
0 개 추천
hi, i have build a matix. i have turned diary mode on ('diary on'). i wanna change just last row color of matix in output file. how? thank you.
채택된 답변
dpb
2021년 7월 4일
See the Limitations and Tips section of the doc for diary
Limitations
Because the output of diary is plain text, the log file does not exactly mirror what you see on screen:
- The diary file does not include graphics (figure windows).
- The diary file does not preserve syntax highlighting and font preferences.
- The diary file shows hidden components in the Command Window, such as hyperlink information generated with matlab:, in plain text. For example, if you enter this statement in the Command Windowstr = sprintf('%s%s', ...
'<a href="matlab:magic(4)">', ...
'Generate magic square</a>');
disp(str)
MATLAB displays
However, the diary file, when viewed in a text editor, shows
str = sprintf('%s%s', ...
'<a href="matlab:magic(4)">', ...
'Generate magic square</a>');
disp(str)
<a href="matlab:magic(4)">Generate magic square</a>
Tips
- To view the contents of the diary file with syntax highlighting, use the type function.
댓글 수: 9
So according to your answer in diary mode it is impossible. In which format can i do the mentioned above question? Tnx
dpb
2021년 7월 5일
That's what the doc says, not me.
I don't have any idea; I use MATLAB to compute with, not for presentation, so I've never looked into any of the report generation stuff.
Tnx
dpb
2021년 7월 5일
I dunno if you were to echo a font color change or embed a TeX color code in the output the result with type would reflect that or not -- that would be only way I could see something might possibly happen with the output stream from diary; as the doc says, all it does is translate and echo what is in the command sequence it sees as the text; the command window display code isn't written to interpret output codes for presentation, it just echoes ASCII characters; only if there is a hardware/software interrupt on a given control string like the linefeed, etc., that is in default terminal display io will those limited control characters be recognized.
I do not fully understand what u said. I just want show one row of matrix with different color in command window and exported file.
See the Tip comment above about type -- it has the facility to draw at least some of the embedded formatting information on the screen when it processes a diary file, but the builtin command window output code simply doesn't have that ability.
"I just want show one row of matrix with different color in command window and exported file."
Well, sometimes we just can't have everything we want. The command window isn't set up to do that; it was a product from 40 years ago when such niceties were unheard of and still is the interface to enter user commands and see output interactively, but is not designed nor intended to be a presentation manager. TMW has products for that purpose specifically or you can export to other formats that do have the facility, but not at the command window.
The new intereactive editor may have some additional facilities; I dunno about that; I've also never used it nor even opened it up as it simply isn't what I'm into with MATLAB. Maybe somebody else will add some other ideas.
Text files also are just that--text files; it takes something like html or other formatting code to produce such effects and then a specialized program to read the file and interpret those commands to put "the right stuff" on the screen. That tool just isn't the command window in MATLAB, sorry.
Thank you for full explanation and the time you spent.
dpb
2021년 7월 6일
No problem...another way to think of it is it's why there is the Interpreter property for text and tick labels, or why need Adobe Reader for pdf files (and why need .pdf and TeX or LaTeX, etc., etc., ...)
Ok.very good.
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기
참고 항목
웹사이트 선택
번역된 콘텐츠를 보고 지역별 이벤트와 혜택을 살펴보려면 웹사이트를 선택하십시오. 현재 계신 지역에 따라 다음 웹사이트를 권장합니다:
또한 다음 목록에서 웹사이트를 선택하실 수도 있습니다.
사이트 성능 최적화 방법
최고의 사이트 성능을 위해 중국 사이트(중국어 또는 영어)를 선택하십시오. 현재 계신 지역에서는 다른 국가의 MathWorks 사이트 방문이 최적화되지 않았습니다.
미주
- América Latina (Español)
- Canada (English)
- United States (English)
유럽
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
