0

In Matlab, I have a IDPOLY object which I wish to "present" and store the resulting text in a text file.

eg if a is an IDPOLY object and I do

>> present(a)

I get

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   

Does anyone know how to capture this text as I'd like to write it to a text file in a log file. There are no returned arguments from present.

mor22
  • 1,372
  • 1
  • 15
  • 32
  • 1
    possible duplicate of [How to get result of DISP as return parameter into a variable?](http://stackoverflow.com/questions/3862815/how-to-get-result-of-disp-as-return-parameter-into-a-variable) – Jonas Nov 24 '10 at 15:48

2 Answers2

1

You can try using the diary command.

lijie
  • 4,811
  • 22
  • 26
0

I've found the evalc() command which does exactly what I need.

evalc

Evaluate MATLAB expression with capture
Syntax

T = evalc(S)
[T, X, Y, Z, ...] = evalc(S)

and pass the expression as a string.

mor22
  • 1,372
  • 1
  • 15
  • 32