我正在Matlab中绘制一些分析结果。我的操作系统是Ubuntu 13.10。我尝试将字母“ä”添加到Matlab图形的标题中,但是得到的是以下内容:
这是我的代码:
function plotResults(data)
% FUNCTION plotResults(data)
ind = 1;
x = 1:length(data{1, end});
for i = 1:length(data)
if mod(i, 5) == 1
figure(ind)
plot(x, data{i, end}, 'b--')
hold on
elseif mod(i, 5) == 2
plot(x, data{i, end}, 'c--')
elseif mod(i, 5) == 3
plot(x, data{i, end}, 'r--')
elseif mod(i, 5) == 4
plot(x, data{i, end}, 'g--')
elseif mod(i, 5) == 0
plot(x, data{i, end}, 'm--')
legend('Random', 'Hill climb', 'Greedy hill climb', 'Stochastic hill climb', 'Hill climb --> Stochastic hill climb')
grid on
xlabel('Aika')
ylabel('Kustannus')
title(['Käsiä : ' num2str(data{i, 2}) ', Suuttimia : ' num2str(data{i, 3})])
ind = ind + 1;
end
end
知道如何正确显示“ä”吗?=)
Thnx寻求任何帮助!
聚苯乙烯
MWE:
plot(1:10, 1:10)
title(['{\"a}{\"o} ' num2str(5) ], 'Interpreter', 'latex')
您可以使用LaTeX:
title(['K\"asi\"a : ' num2str(data{i, 2}) ', Suuttimia : ' num2str(data{i, 3})])
请参见是否可以在MATLAB图形标签中显示unicode?以及如何在书目中写上“ä”和其他变音符号和重音字母?
或尝试使用unicode方法:
title(['K', char(228), 'si', char(228) : ' ....
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句