Undefined function 'atand' for input arguments of type 'sym'. how to solve this error?

I'm running the follow code lines
% tanB1 = X and tanB2 = Y
Cp = 1005
Ca = 200; % input
Um = 256; % input
temp_rise = 34.5; % input
lambda = 0.84; % from stages (input)
DoR_factor = 0.5;% input
TpR = temp_rise*Cp/(lambda*Um*Ca);
DoR = DoR_factor*2*Um/Ca;
syms X Y
Eqn1 = 'TpR = X - Y';
Eqn2 = 'DoR = X + Y';
S = solve(Eqn1, Eqn2, X, Y);
soln = [S.X, S.Y];
m2 = subs(soln);
% deflection
B1 = atand(m2(1,1))
B2 = atand(m2(1,2))
% air angles from B1 and B2
A1 = atand(Um/Ca - tand(B1));
A2 = atand(Um/Ca - tand(B2));
deHall = (Ca/cosd(B2))/(Ca/cosd(B1));
% [B1, B2, A1, A2, 0, deHall];
A_angle = [B1, B2, A1, A2, 0, deHall]
But I am getting an error on the line B1,
??? Undefined function or method 'atan2' for input arguments of type 'sym'.
Any Ideas how to solve this problem?
Thanks!!

 採用された回答

Mischa Kim
Mischa Kim 2015 年 5 月 31 日
Tin, you need to convert the symbolic expressions. Use
B1 = atand(double(m2(1,1)))
B2 = atand(double(m2(1,2)))

その他の回答 (1 件)

Walter Roberson
Walter Roberson 2015 年 5 月 31 日
sym atand(x)
atand(x) = atan(x * 180/sym('PI'))
If necessary use a different function name.
atan is specifically documented to work on symbolic values.

カテゴリ

タグ

質問済み:

2015 年 5 月 31 日

コメント済み:

2015 年 5 月 31 日

Community Treasure Hunt

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

Start Hunting!

Translated by