Not enough input arguments integral

3 次查看(过去 30 天)
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 个)

Community Treasure Hunt

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

Start Hunting!

Translated by