필터 지우기
필터 지우기

How can I add text, containing a matrix, to a plot?

조회 수: 13 (최근 30일)
Jens Weber
Jens Weber 2017년 7월 30일
편집: dpb 2017년 7월 31일
How can I add text, containing a matrix, to a plot?
  댓글 수: 2
dpb
dpb 2017년 7월 30일
Dunno. What is the form of this text and how can text "contain" a matrix?
You mean just read a text/data file skipping a bunch of nonumeric data, maybe?
Jens Weber
Jens Weber 2017년 7월 31일
편집: dpb 2017년 7월 31일
thanks for your comment as well. In the meanwhile a found the following answer:
A = [ 1 2; 3 4 ]
str = [ 'Transformationsmatrix \it{A} = ', '$$ \left[ {\matrix{ ',num2str(A(1,1)),' & ', num2str(A(1,2)),...
' \cr ', num2str(A(2,1)) , ' & ', num2str(A(2,2)),' } } \right] $$' ];
title(str,'Interpreter','latex')

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

채택된 답변

Jan de Jong
Jan de Jong 2017년 7월 31일
Do you mean something like this? text(1,1,[num2str(magic(3))])
  댓글 수: 1
Jens Weber
Jens Weber 2017년 7월 31일
Hello Jan, thanks for your answer. in the meanwhile I found the following solution:
A = [ 1 2; 3 4 ] str = [ 'Transformationsmatrix \it{A} = ', '$$ \left[ {\matrix{ ',num2str(A(1,1)),' & ', num2str(A(1,2)),... ' \cr ', num2str(A(2,1)) , ' & ', num2str(A(2,2)),' } } \right] $$' ]; title(str,'Interpreter','latex')

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

추가 답변 (0개)

카테고리

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

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by