Separating Complex equation into real and

1 view (last 30 days)
Hi is there anyone who could help me. I have a transfer function and I managed to get it to the part where I need to separate Transfer function, which is a complex equation into two separate vectors, to get the Amplitudinal frequency characteristics A(omega) and the Phase frequency char fi(omega). I have tried the "children" command, but it just gives me error, no matter what I try, examples does not work also.
Maybe my function is damaged, maybe someone can post it so I could correct my one.
ERROR TEXT _________________________________________________________________
>> children(x+2*x)
??? Undefined function or method 'children' for input arguments of type 'sym'.
>> children('x+2*x')
??? Undefined function or method 'children' for input arguments of type 'char'.
PrefsDialog.commitChanges: exception detected in method commitPrefsChanges in class class com.mathworks.mlwidgets.mlservices.scc.SccPrefsPanel.
>> children(sym'x+2*x')
??? children(sym'x+2*x')
|
Error: Unexpected MATLAB expression.
>> children(sym('x+2*x'))
??? Undefined function or method 'children' for input arguments of type 'sym'.
>> children(sym('a + b + c'))
??? Undefined function or method 'children' for input arguments of type 'sym'.
>> children([x+2*x])
??? Undefined function or method 'children' for input arguments of type 'sym'.
>> children(sym[x+2*x])
??? children(sym[x+2*x])
|
Error: Unbalanced or unexpected parenthesis or bracket.
>> children(sym(x+2*x))
??? Undefined function or method 'children' for input arguments of type 'sym'.
----------------------------------------------------------------
Conj() also returns not what i expect
conj(d)
ans =
162*conj(w)^3*i - 99*conj(w)^2 - 18*conj(w)*i + 1

Answers (1)

Walter Roberson
Walter Roberson on 12 Apr 2012
children() must be from a later version of MATLAB then you have. Even if you had it in your version, it would be the wrong thing to use.
You should be using abs() and arg() to get the magnitude and the phase.
  2 Comments
Algirdas Kluonius
Algirdas Kluonius on 12 Apr 2012
matlab 2011a not new enough? the same thing happens about arg , and abs gives nothing jus >>ans= abs('variable')
Walter Roberson
Walter Roberson on 12 Apr 2012
Yes, children is new as of R2012a
http://www.mathworks.com/help/toolbox/symbolic/rn/bs7vfwy.html
Use feval(symengine, 'op', sym('x+2*x'))
http://www.mathworks.com/help/toolbox/mupad/stdlib/op.html
Also try
syms x
f = x * 2i*x;
abs(f)
angle(f)
Note the correction of arg -> angle
(I'm not sure not where I found arg before)

Sign in to comment.

Tags

No tags entered yet.

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!