1

I have written matlab programs that produce plots and tables for chemical substances. I get my input mostly from excel tables and a local MySql database. My problem is quite a few substance names contain greek letters.

My problem is I want to create plots that use exactly the names specified by my collegues. And also create tables that show the correct symbol.

An example: If I create an excel file containing: "α-Methylstyrol" in the first cell and read it with [~,~,tmp] = xlsread('test.xlsx'). tmp will contain '(box with question mark)-Methylstyrol'. If I use the string in a plot (title(tmp)) it will be shown as: '(right arrow)-Methylstyrol'


So far I tried the native2unicode and unicode2native commands on the string but there is no effect. Also I tried replacing the characters but the number of characters I need to replace is growing way too fast for me - so I'm really hoping there would be a more systematic way.

(We know there are also names that wouldn't contain greek letters - but we try to adhere to some guidelines which prefer these names.)

4

2 回答 2

0

据我了解,Matlab 不能很好地支持 unicode。但是,可以使用 LaTex 语法在图像标题中键入希腊字母。

title('\alpha-Methanol')

即使它不是最好的解决方案,我认为应该可以用 LaTex 关键字替换 unicode 符号。

于 2013-05-15T13:15:25.757 回答
0

我认为,您的问题是,xlsread甚至没有从您的工作表中得到正确的希腊字母。试试 jexcelapi
或poi。两个链接都指向用于导入 xls 文件的 java 类。在 MATLAB 中,您只需将 jar 文件添加到您的路径中,接下来的步骤就像基本的 java 编码一样。javaaddpath

于 2013-05-15T13:23:20.770 回答