필터 지우기
필터 지우기

Need help with an integral with variable bounds

조회 수: 2 (최근 30일)
Tim Stark
Tim Stark 2018년 12월 1일
댓글: madhan ravi 2018년 12월 1일
Hey guys, I need help with an integral using variable bounds.
I Have a certain function:
f = @(t) [function]
And I want to Integrate this function with respect to t, so:
Nf = integral(f,x,y)
However, x and y are variables:
i = 1:35040
x = (1/(24*4))*(i-1)
y = (1/(24*4))*i
I want to store the results of these integration in a matrix:
M = [Nf(1), NF(2), .., NF(35040)]
A loop function does not seem to work:
for i=1:35040
f = @(t) [function]
x = (1/(24*4))*(i-1)
y = (1/(24*4))*i
Nf = integral(f,x,y)
end

채택된 답변

madhan ravi
madhan ravi 2018년 12월 1일
syms x y %example
f = @(t) sin(t)
Nf = int(f,x,y)
i = 1:35040;
x = (1/(24*4))*(i-1);
y = (1/(24*4))*i;
result=vpa(subs(Nf),2)
  댓글 수: 2
Tim Stark
Tim Stark 2018년 12월 1일
Thanks a lot!
madhan ravi
madhan ravi 2018년 12월 1일
Anytime :)

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

제품


릴리스

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by