hi,
syms Phase(a,u);
phase(a,u)=(atan(a)-atan(1/a)*u*180/pi);
this returns
atan(3) - (18*atan(1/3))/pi
for
phase(3,0.1)
how can I take the numeric value not an expression
regards.

回答 (2 件)

Steven Lord
Steven Lord 2018 年 10 月 15 日

1 投票

Since the resulting symbolic expression does not contain any symbolic variables, just call double on it. If later you want to approximate a symbolic expression that does contain symbolic variables, call vpa on it instead or use subs to substitute values for the symbolic variables.
madhan ravi
madhan ravi 2018 年 10 月 15 日

0 投票

phase=@(a,u)(atan(a)-atan(1/a)*u*180/pi)
phase(3,1) % a=3 & u = 1

カテゴリ

タグ

質問済み:

2018 年 10 月 15 日

回答済み:

2018 年 10 月 15 日

Community Treasure Hunt

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

Start Hunting!

Translated by