필터 지우기
필터 지우기

Numerical integration in matlab2018

조회 수: 4 (최근 30일)
Pavan Kumar
Pavan Kumar 2019년 4월 22일
댓글: Adam Danz 2019년 4월 22일
Dear Friends,
This looks simple but am not able to get it. Could you help me out.
I have the following variable in a equation that needs to be integrated
its like
L = linspace(0.3,4.5,2000);
T = 100;
fun = @(T) ((0.4175./L.^3) - (0.6643./L.^2) + (0.9036./L) + 3.5332 - 0.0744.*L).*10^-5.*(1 + 0.00276.*T);
q = integral(fun,20,T)
However, when i rum this, iam getting an error. Could you help me out on solving this.
  댓글 수: 3
Pavan Kumar
Pavan Kumar 2019년 4월 22일
I dint get you completely...
Do i need to use a for loop for this kind of integration?
Adam Danz
Adam Danz 2019년 4월 22일
Check out these examples provided by matlab (link below). When you evalue the functions in those example, you'll see that they return a single value.
When I evaluate your function, a vector is returned:
>> fun(20)
ans =
Columns 1 through 6
0.00015411 0.00015159 0.00014914 0.00014676 0.00014444 0.0001422
Columns 7 through 12
0.00014002 0.0001379 0.00013584 0.00013383 0.00013189 0.00012999
Columns 13 through 18
0 ...... (2000 elements long)
Did you expect that your function returns a single value or do you expect that it returns a vector?

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

답변 (0개)

카테고리

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

제품

Community Treasure Hunt

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

Start Hunting!

Translated by