matlab – Octave integration does not evaluate definite integral with symbolic variables

matlab – Octave integration does not evaluate definite integral with symbolic variables

You can use eval in order to evaluate (duh) the integral. E.g. with your code above, I get:

octave:9> eval( convolution )
ans = (sym)
  ⎧ 2                                                   
  ⎪t    2⋅cos(Wn⋅t)    2                                
  ⎪── + ─────────── - ───  for Wn > -∞ ∧ Wn < ∞ ∧ Wn ≠ 0
  ⎨Wn         3         3                               
  ⎪         Wn        Wn                                
  ⎪                                                     
  ⎩          0                       otherwise          

Note that if you actually define some of those symbols on the workspace, then these get taken into account:

octave:10> Wn = 1;   % or preferably `sym(1)` ...
octave:11> eval( convolution )
ans = (sym)
   2               
  t  + 2⋅cos(t) - 2

matlab – Octave integration does not evaluate definite integral with symbolic variables

Leave a Reply

Your email address will not be published.