Not enough input arguments integral

조회 수: 5 (최근 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 CenterFile Exchange에서 Functional Programming에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by