【问题标题】:How do I capture the output from the "present" function and store it in a string如何捕获“present”函数的输出并将其存储在字符串中
【发布时间】:2011-05-15 02:37:01
【问题描述】:

在 Matlab 中,我有一个 IDPOLY 对象,我希望将其“呈现”并将生成的文本存储在文本文件中。

例如,如果a 是一个 IDPOLY 对象,我就是

>> present(a)

我明白了

Discrete-time IDPOLY model: A(q)y(t) = B(q)u(t) + e(t)                
A(q) = 1 - 1.31 q^-1 + 0.2425 q^-2 - 0.431 q^-3 + 0.4987 q^-4         

B1(q) = 0.01357 + 0.04006 q^-1 - 0.04489 q^-2 + 0.007757 q^-3         
              - 0.1761 q^-4 + 0.06396 q^-5 - 0.2874 q^-6 + 0.3835 q^-7


B2(q) = -0.006397                                                     

Estimated using ARX with focus on data set iddata_est_shift           
Loss function 0.0617185 and FPE 0.061879                              
Sampling interval: 0.025                                              
Created:       24-Nov-2010 13:05:10                                   
Last modified: 24-Nov-2010 13:06:56   

有谁知道如何捕获此文本,因为我想将其写入日志文件中的文本文件。 present 没有返回参数。

【问题讨论】:

标签: matlab text-capture


【解决方案1】:

您可以尝试使用diary 命令。

【讨论】:

    【解决方案2】:

    我找到了 evalc() 命令,它完全符合我的需要。

    evalc
    
    Evaluate MATLAB expression with capture
    Syntax
    
    T = evalc(S)
    [T, X, Y, Z, ...] = evalc(S)
    

    并将表达式作为字符串传递。

    【讨论】:

      猜你喜欢
      • 2017-10-03
      • 2013-11-07
      • 1970-01-01
      • 2014-07-29
      • 2014-08-29
      • 1970-01-01
      • 2013-03-22
      • 1970-01-01
      • 2022-07-20
      相关资源
      最近更新 更多