Separating Complex equation into real and

2 次查看(过去 30 天)
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

回答(1 个)

Walter Roberson
Walter Roberson 2012-4-12
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 个评论
Algirdas Kluonius
Algirdas Kluonius 2012-4-12
matlab 2011a not new enough? the same thing happens about arg , and abs gives nothing jus >>ans= abs('variable')
Walter Roberson
Walter Roberson 2012-4-12
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)

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Formula Manipulation and Simplification 的更多信息

标签

尚未输入任何标签。

产品

Community Treasure Hunt

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

Start Hunting!

Translated by