Integration a multivariable function wrt to just 1

1 view (last 30 days)
Hi guys,
I'm trying to integrate a function that consists of 3 variables, i,j, and y, wrt to y.
This is what I have came up with. It doesn't work in the sense that after the integration, if I try to input values for i and j, there is an error.
fun_wing = @(y,i,j) rho.*A.*((((y./l).^(i+1)).*(2+i-i.*(y./l)))./(i.*(i+1).*(i+2))).*((((y./l).^(j+1)).*(2+j-j.*(y./l)))./(j.*(j+1).*(j+2)));
M_wing = @(i,j) integral(@(y) fun_wing(y,i,j),0,1);
rho is a value that I have defined, and A is a function in terms of y, as follows.
A = @(y) 0.05.*(4-2.*y./l+((y.*y)./(l.*l)));
Please advice!
Thanks in advance.
Cheers, Jason

Accepted Answer

Walter Roberson
Walter Roberson on 30 Sep 2015
You define A as an anonymous function, but in fun_wing you attempt to multiply the handle of the function by something. You need to invoke the function, A(y) instead of just the name A
  1 Comment
Jason Ong
Jason Ong on 1 Oct 2015
Thank you so much! I'm still new at this guess that's why I got the fundamentals wrong. You're the man!

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!