confusion matrix with string greek letters like alpha and beta

조회 수: 3 (최근 30일)
LuMig
LuMig 2022년 9월 16일
댓글: LuMig 2022년 9월 20일
I have a string matrix with is supposed to have greek letters.
Example: My matrix contains the abbreviation: B-Glc, but I want it to appear as β-Glc in the matrix and on the axis of the confusion matrix.
I have tried '/beta' but it did not work.
Thnak you
  댓글 수: 3
LuMig
LuMig 2022년 9월 16일
편집: LuMig 2022년 9월 16일
function confusionchart from Statistics and Machine Learning Toolbox
.
I want to display the class labels on the axes as greek letters rather than normal letters
LuMig
LuMig 2022년 9월 16일
\beta does not work

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

답변 (2개)

Rik
Rik 2022년 9월 16일
If you use the actual greek letters, that should work (as long as the function supports all implemented characters):
text(1,1,char(945:969))
axis([0 5 0 2])
  댓글 수: 1
Walter Roberson
Walter Roberson 2022년 9월 17일
Unfortunately, confusionchart does not have any control over interpreter. However if you insert unicode characters into the class labels, the characters will be drawn (if present in the font.)

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


LuMig
LuMig 2022년 9월 19일
I solved this issue (only a turnaround)
% alpha is the greek letter
alpha = cellstr(char(945));
% Label1 is the true label and I am appending an optional string to alpha.
% Label(1,1) will contain /alpha-Glu in greek
Label1(1,1)= strcat(string(alpha), '-GLu');
Label2(1,1)=strcat(string(alpha), '-MM');
% Apply confusionchart to Label1 and Label2
confusionchart(categorical(Label),categorical(Label2));
the class labels on the axes as greek letters rather than normal letters
  댓글 수: 2
Walter Roberson
Walter Roberson 2022년 9월 19일
Why do you cellstr() and then string() ? Why not directly string()?
alpha = string(char(945));
Label1(1,1) = alpha + "-GLu";
Label2(1,1) = alpha + "-MM";
LuMig
LuMig 2022년 9월 20일
You are right, no need to cellstr() and string(). Thank you

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

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by