Hi!
I'm trying to calculate a simple function, separated in three parts (see code below). The function should be the input for a fzero function, where an extreme value for alpha is determined.
function time = uebung42(alpha)x = 200;y = 120;yL = 70;yW = y - yL;vw = (7 * 1000) / 60 / 60;vl = 3*vw;term1 = (-yL * cos(alpha)) / (vl * (sin(alpha))^2);term2 = yL * ((-sin(alpha))^2 - (cos(alpha))^2) * (x - (yL * cos(alpha)) / sin(alpha));term3 = vw * (sin(alpha))^2 * sqrt( yW^2 + (x - (yL * cos(alpha)) / sin(alpha))^2);time = term1 - ( term2 / term3);end
Each individual term1-3 has a result and works fine, but when it try the fzero function, it gives me the following error message:
>> fun = @uebung42fun = @uebung42>> alpha = fzero(uebung42,1)Error using uebung42 (line 11)Not enough input arguments.
Line 11 means the calculation for term1, but I just can't seem to find whats wrong with it. Any ideas?
Best Answer