"Torsten" wrote in message <firstname.lastname@example.org>... > "Young " <email@example.com> wrote in message <firstname.lastname@example.org>... > > Hi > > > > I have an equation: F=L*cos(theL). L is a constant. Integral of F over zero to (1/2)pi should give L. But I could not make that answer Please see below my code and help me how to fix this problem. I have much more complex equation but simplified my problem to this example. > > > > syms L; > > theL=[0+0.001:pi/1000:pi/2-0.001] > > F=L*cos(theL); > > trapz(theL,F) > > > > ans: (21828504695225120901251714223243*L)/162259276829213363391578010288128 + (634496096455597832693*pi*L)/2305843009213693952000 > > If you know the explicit formula for the function you want to integrate, then > for symbolic integration use MATLAB's "int", for numerical integration use MATLAB's "quad". > > Best wishes > Torsten.
Thanks for your help! But it did not work... Please see below. It looks "quad" does not allow to use sym... I need to use numerical solution.