Calling a function in another function

Asked by Haojie on 10 Jul 2012
Latest activity Edited by Haojie on 10 Jul 2012

I am really new to matlab. When I wrote two functions like this:

funw.m

function q = funw(t)

h=0;

r=1/7;

 q = quadl(@(x) sqrt(t^(2*r)-x.^(2*r)),h,t)...
 -quadl (@(x) sqrt(x.^(2*r)-t^(2*r)),t,(h+2));

return

VentRate.m

function w = VentRate

global elev;

global h;

w = fzero(@funw,(h+elev)/2);

return

I try to use VentRate to call funw, by typing VentRate in the command window, but it will show some error. However, if i directly write w = fzero(@funw,(h+elev)/2) in the command window, it will run without error. So can anyone tell me what is wrong with the second function? I appreciate your help.

0 Comments

Haojie

Products

No products are associated with this question.

0 Answers

Contact us