【问题标题】:Latex function in MatlabMatlab中的乳胶函数
【发布时间】:2014-11-07 10:44:04
【问题描述】:

我想在 Matlab 2013b 中使用乳胶功能。这个函数的使用很简单,并且可以按我的预期工作:

s = sym('s');
latex((s+1)/3)

ans =

\frac{s}{3} + \frac{1}{3}

比我有一个简单的矩阵和乳胶函数返回以下错误:

A = [ 0 1 0; 1 -2 1; -2 4 -2];
latex(A)
Undefined function 'latex' for input arguments of type 'double'.

另一个例子:

latex(3/4 + 4)
Undefined function 'latex' for input arguments of type 'double'.

In 适用于符号变量,但不适用于整数。问题可能出在哪里?

【问题讨论】:

    标签: matlab double latex


    【解决方案1】:

    来自文档:符号表达式的 LaTeX 表示

    做:

    latex(sym(A))
    latex(sym(3/4+4)) % But this will return the result of the numbers, so \frac{19}{4}
    

    【讨论】:

    • 谢谢,如果我不想修改表达式怎么办?即我需要得到 \frac{3}{4} + 4
    • @user1313386 我不太确定你能不能......我猜像 strcat(latex(sym(3/4)),'+4) 或类似的东西......
    猜你喜欢
    • 1970-01-01
    • 2012-08-15
    • 2017-09-14
    • 2020-01-02
    • 1970-01-01
    • 2019-08-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多