Matlab:为图形添加符号 [英] Matlab: Adding symbols to figure

查看:226
本文介绍了Matlab:为图形添加符号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

下面是我创建的用于模拟LDPC编码和解码的用户界面 alt text http ://img225.imageshack.us/img225/7775/ldpcgui.jpg



通过在左右节点之间传递值来迭代地解码代码序列通过连接。



为了提高可视化效果,添加第一件事就是向传递值的方向添加箭头。另一种方法是在连接顶部绘制一个更大的箭头来显示方向。



我想要做的另一件事是在连接下方显示当前的数学运算(在这个例子中是c * H')。我不知道该怎么做,就是在图中显示特殊字符和数学符号以及其他种类的文字,如下标和上标(例如和符号和下标T代替符号来表示转置矩阵)。

如果任何人都能指出任何有用的资源来解决上述问题或显示解决方案,我将非常感激。



谢谢。

解决方案

要添加箭头,您可以使用内置的 QUIVER ,或者,对于更多选项, ARROW 。这两个都必须绘制到坐标轴中,所以如果您想在顶部使用大箭头,则必须在主轴上方创建一组额外的坐标轴。



据我所知,您不能在 text uicontrols中使用TeX或LaTeX符号。但是,您可以在轴标签中使用它们。因此,我建议您在轴上添加 XLabel ,例如

  xlabel('\sigma c * H_T')

或(注意需要$ -signs对于LaTeX)

  xlabel('$ \sum c * H_T $','interpreter','latex')

编辑

我没有提及使用 text (正如 @ gnovice @YYC ),因为我认为无法在轴之外放置文本。事实证明,我错了。 text(0.5,-0.2,'\Sigma etc。')也应该正常工作。我猜想使用'xlabel'的唯一好处是,您可以在创建GUI时轻松添加和定位轴标签。


Below is the user interface I have created to simulate LDPC coding and decodingalt text http://img225.imageshack.us/img225/7775/ldpcgui.jpg

The code sequence is decoded iteratively by passing values between the left and right nodes through the connections.

The first thing it would be good to add in order to improve visualization is to add arrows to the connections in the direction of passing values. The alternative is to draw a bigger arrow at the top of the connection showing the direction.

Another thing I would like to do is displaying the current mathematical operation below the connection (in this example c * H'). What I don't know how to do is displaying special characters and mathematical symbols and other kinds of text such as subscript and superscript in the figure (for example sum sign and subscript "T" instead of sign ="'" to indicate transposed matrix).

I would be very thankful if anyone could point to any useful resources for the questions above or show the solution.

Thank you.

解决方案

To add arrows, you can either use the built-in QUIVER, or, for more options, ARROW from the file exchange. Both of these have to be plotted into axes, so if you want a big arrow on the top, you have to create an additional set of axes above the main axes.

As far as I know, you cannot use TeX or LaTeX symbols in text uicontrols. However, you can use them in axes labels. Thus, I suggest that you add an XLabel to the axes, for example

xlabel('\sigma c*H_T')

or (note the $-signs required for LaTeX)

xlabel('$\sum c*H_T$','interpreter','latex')

EDIT

I hadn't mentioned the use of text (as suggested by @gnovice and @YYC) because I thought it wasn't possible to place text outside of the axes. It turns out that I was wrong. text(0.5,-0.2,'\Sigma etc.') should work fine as well. I guess the only advantage of using 'xlabel' would be that you can easily add and position the axes label during GUI creation.

这篇关于Matlab:为图形添加符号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆