Integration of MATLAB function - NOT Mathematic function.
이전 댓글 표시
Hi, I have three MATLAB script, with one serve as a main class. I want to integrate an expression which contain two other functions,
Code:
x = 0:180;
TB = integral(getCt_Theta(x)*getQ_2(x),1,180);
Where: getCt_Theta(x), is a function to calculate coefficient of lift, will return one values for each inputs Same goes for getQ_2(x), The reason for this task is to evaluate half revolution of the turbine. Should I do symbolic first? or should I Simulink it?
Thanks everyone!
댓글 수: 2
Walter Roberson
2016년 9월 2일
Your x is the integral values from 0 to 180, but you mention x in your integral() and you want the integral to be over 1 to 180. Is your x intended to be continuous or discrete, and is it intended to be 0 to 180 or 1 to 180 ?
채택된 답변
추가 답변 (1개)
Pawel Ladosz
2016년 9월 2일
You could try and change your matlab function to function handle by:
getCt_Theta_fun=@getCt_Theta
Then you can use this is as input to integral. However I am not sure whether it would deal with multiplication of the function handles.
댓글 수: 3
Adam
2016년 9월 2일
Or
f = @(x) getCt_Theta(x)*getQ_2(x)
if that is what is in question, then you just have 1 function handle.
Echo-6
2016년 9월 3일
편집: Walter Roberson
2016년 9월 3일
Walter Roberson
2016년 9월 3일
f = @(theta) getQ_2(theta);
카테고리
도움말 센터 및 File Exchange에서 MATLAB에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!