Integrate in time domain

조회 수: 2 (최근 30일)
Sreet Swastik
Sreet Swastik 2013년 3월 28일
I have a function named Kp*e... How do I integrate it in MATLAB say from 0 to 5?

답변 (1개)

Mahdi
Mahdi 2013년 3월 28일
You can use the int(expr,var,a,b) function.
So in your case, it would be
syms e Kp
int(Kp.*e, e, 0,5)
The result would be 25.*Kp/2. You can obviously play around with this by setting Kp to a value, and so on...
  댓글 수: 2
Sreet Swastik
Sreet Swastik 2013년 3월 28일
int(Kp*e, e, 0,5)
??? Undefined function or method 'int' for input arguments of type 'double'
This is the error when I do it!
Mahdi
Mahdi 2013년 3월 28일
Did you use the line before it? You need syms e Kp fo this to work. (Sets Kp as a symbol). You can also do this for example:
Kp=4.4 % A number I chose
syms e
int(Kp.*e, e, 0,5)

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Mathematics에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by