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

10 次查看(过去 30 天)
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