Not enough input arguments integral

3 views (last 30 days)
I have code,but get error:
i=complex(0,1);
f=@(t)26+sinh(t);
u110=exp^(i*(int(f,0,0)))/25;

Accepted Answer

Star Strider
Star Strider on 18 Apr 2017
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 Comments
Opera Era
Opera Era on 18 Apr 2017
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 on 18 Apr 2017
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.

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!