命令行中的希伯来语 - matlab
可能的重复:
文本('希伯来字符串')matlab
shalom
我正在尝试在 matlab 中使用希伯来字符串。但是当我尝试将希伯来字符串分配给变量时,它不会分配它。例如:
<块引用>a='א'
一=
有什么想法吗?
Possible Duplicate:
text('hebrew string') matlab
shalom
I am trying to work with hebrew strings in matlab. but when I am trying to assign hebrew string to a variable, it doens't assign it. for example:
a='א'
a =
any ideas why?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Aleph 采用 UTF-16,matlab 用其标准表示2 字节
char
格式。它可能不支持这种方式的输入。您可能必须这样做
,然后以 UTF-16 可读的方式输出它。
如果你想简单地将希伯来语放入图形标题或其他东西中,那么你可以直接像这样编写Latex:
如果你尝试使用Matlab进行文本处理,我认为它会起作用,但你可能无法查看字符在Matlab命令窗口中。
更新:在我的系统上,甚至不支持以希伯来语编码写入文件:
但如果您设置了希伯来语语言,也许您的机器支持它。
Aleph is in UTF-16, which matlab represents with its standard 2 byte
char
format. It probably doesn't support input of it this way.You probably have to do
And then output it some way readable by UTF-16.
If you're trying to simply put Hebrew into a figure title or something, then you can directly write Latex like this:
If you are trying use Matlab for text processing, I think it will work but you might not be able to view the characters in the Matlab command window.
Update: On my system even writing to a file in the Hebrew encoding is not supported:
But maybe your machine supports it if you have Hebrew languages set up.
在这种情况下,我将执行以下操作来读取/写入文件:
为了显示此字符串,我们需要通过调用使 MATLAB 识别 Unicode 字符:
现在在命令提示符下,您可以尝试:
但是,使用 < 显示字符串a href="http://www.mathworks.com/help/techdoc/ref/text.html" rel="nofollow noreferrer">TEXT 函数失败(有人可以确认这个答案实际上如声称的那样工作吗?):
我什至检查了正确的字体是否可用:
另一方面,正如我在 我之前的回答 ,在 GUI 中显示此文本的解决方案是使用 Java (MATLAB UICONTROL 基于 Java Swing 组件):
(请注意,通过使用UICONTROL,即使是常规的“Arial”字体也能显示正确的输出!)
This is what I would do to read/write to files in this case:
For displaying this string, we need to make MATLAB aware of Unicode characters by calling:
Now on the command prompt you can try:
However, displaying the string with the TEXT function failed (Can someone confirm if this answer actually works as claimed?):
I even checked that the correct fonts are available:
On the other hand, and as I showed in a previous answer of mine, the solution to showing this text in a GUI is to use Java (MATLAB UICONTROL is based on Java Swing components):
(note that by using UICONTROL, even the regular 'Arial' font shows the correct output!)