Effacer les filtres
Effacer les filtres

Separating Complex equation into real and

2 vues (au cours des 30 derniers jours)
Algirdas Kluonius
Algirdas Kluonius le 12 Avr 2012
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

Réponses (1)

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

Connectez-vous pour commenter.

Catégories

En savoir plus sur Formula Manipulation and Simplification dans Help Center et File Exchange

Tags

Aucun tag saisi pour le moment.

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by