Not enough input arguments integral

2 ビュー (過去 30 日間)
Opera Era
Opera Era 2017 年 4 月 18 日
コメント済み: Star Strider 2017 年 4 月 18 日
I have code,but get error:
i=complex(0,1);
f=@(t)26+sinh(t);
u110=exp^(i*(int(f,0,0)))/25;

採用された回答

Star Strider
Star Strider 2017 年 4 月 18 日
You need to use this form for the exponential function:
u110=exp(i*(integral(f,0,0)))/25;
If you have R2012a or later, use the integral function, not int (which is the Symbolic Math Toolbox integral function). If you are using an earlier version, use the quad function or its friends.
Also, you are integrating from 0 to 0, giving you an integral of 0, so you probably want to check that.
  2 件のコメント
Opera Era
Opera Era 2017 年 4 月 18 日
Thank you,but why this:
u210=diff(exp(i*integral(f,0,0))/((25)^(1/4)));
doesn't work,in Workspace I get [] .
Star Strider
Star Strider 2017 年 4 月 18 日
The diff function in core MATLAB takes the differences between elements of a vector, and in the Symbolic MAth Toolbox calculates the symbolic derivative.
In either situation, there is only one element in ‘u210’, so there is no difference to take, so it returned the empty matrix for the difference, and would return 0 for the derivative (of a constant).
Please note that you are evaluating it from a lower limit of integration of 0 to an upper limit of integration of 0, giving you a result of 0.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeFunctional Programming についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by