フィルターのクリア

Info

この質問は閉じられています。 編集または回答するには再度開いてください。

Having difficulty performing symbolic integral

2 ビュー (過去 30 日間)
Faraz Vossoughian
Faraz Vossoughian 2017 年 12 月 18 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
In my code the part im trying to calculate A0 , A1,A2 and zerolift i get the following error
Invalid indexing or function definition. Indexing must follow
MATLAB indexing. Function arguments must be symbolic variables,
and function body must be sym expression.
please someone help me.
Thank you,
syms xc tetan
alpha=input('alpha in D')
alpha=deg2rad(alpha);
zc= 0.48*xc*(xc-1)^2;%change
dzdx=diff(zc,xc);%change
xc=0.5*(1-cos(tetan));
dzdx=(12*xc*(2*xc - 2))/25 + (12*(xc - 1)^2)/25;
%A0
int=int(dzdx,tetan,0,pi);
int=int/pi;
Anot=alpha-(int)
%A1
n=1
int1=int(dzdx*(cos(1*tetan)),tetan,0,pi);%first part
A1=(2/pi)*(int1)
%A2
n=2
int2=int(dzdx*(cos(2*tetan)),tetan,0,pi);%first part
A2=(2/pi)*(int2)
%zerolift
int3=int((cos(tetan)-1)*dzdx,tetan,0,pi)
alphaZ=(-1/pi)*int1;

回答 (1 件)

Walter Roberson
Walter Roberson 2017 年 12 月 18 日
Your line
int=int(dzdx,tetan,0,pi);
redefines int from being a function into being a variable.
  2 件のコメント
Faraz Vossoughian
Faraz Vossoughian 2017 年 12 月 18 日
so what would you suggest doing at this point?
Walter Roberson
Walter Roberson 2017 年 12 月 18 日
Do not use int as a variable name.
temp1 = int(dzdx,tetan,0,pi);
temp2 = temp1 / pi;
Anot = alpha - temp2;

この質問は閉じられています。

Community Treasure Hunt

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

Start Hunting!

Translated by