why my integral is not a numerical value?

3 ビュー (過去 30 日間)
Rabih Sokhen
Rabih Sokhen 2021 年 10 月 11 日
コメント済み: Rabih Sokhen 2021 年 10 月 11 日
code:
z=100;
n=100;
m=70;
qu= linspace(-2*pi,2*pi,m);
theta=linspace(-2*pi,2*pi,n);
qq=2*pi+pi*(-1.8);
target_qq=ceil(z*qq/(4*pi));
syms q
fct= ((1+exp(-2.*(asinh(sin(q/2)))))^(-0.5)).*[1;1-exp(-asinh(sin(q/2))-1i*q/2)]*exp(1i*(qu(target_qq).*n/2 + theta(target_qq).*m/2));
ket=diff(fct);
bras=fct';
f=bras*ket;
phase=1i*int(f,q,-2*pi,2*pi)
%this is my code, the probleme is in the last line, i want to obtain the phase as a numerical value but matlab keep writing it as a full expression
how can i fix this
thanks in advance
ps: i am using matlab 2019b

採用された回答

Matt J
Matt J 2021 年 10 月 11 日
f=matlabFunction( bras*ket);
phase=1i*integral(f,-2*pi,2*pi)
  1 件のコメント
Rabih Sokhen
Rabih Sokhen 2021 年 10 月 11 日
thanks youu
it work fine

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSymbolic Math Toolbox についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by