Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Calculating double integral

Subject: Calculating double integral

From: Haojie

Date: 2 Apr, 2012 19:17:11

Message: 1 of 3

Hi all,

I try to calculate the double integral of
200*(0.4*U/log(y/10)).^2*y/U/(1+50*x*y/U).^(5/3)
x from 0 to H
y from U/l to 10000(or infinity)
where U and l are constant H is the input

Here is what i wrote

function d=SpectrumV(H)
U=3;
l=1;
d=dblquad (@int,0,H,U/l,10000);
return
function s = int(x,y)
U=3;
 s = 200*(0.4*U/log(y/10)).^2*y/U/(1+50*x*y/U).^(5/3);
return

but when I try to run it, it will show:
??? Error using ==> mldivide
Matrix dimensions must agree.
I really appreciate if you can help. Im quite new to matlab so there might be some very stupid mistakes inside.....

Subject: Calculating double integral

From: Torsten

Date: 3 Apr, 2012 06:55:17

Message: 2 of 3

On 2 Apr., 21:17, "Haojie " <wanghaojie...@gmail.com> wrote:
> Hi all,
>
> I try to calculate the double integral of
> 200*(0.4*U/log(y/10)).^2*y/U/(1+50*x*y/U).^(5/3)
> x from 0 to H
> y from U/l to 10000(or infinity)
> where U and l are constant H is the input
>
> Here is what i wrote
>
> function d=SpectrumV(H)
> U=3;
> l=1;
> d=dblquad (@int,0,H,U/l,10000);
> return
> function s = int(x,y)
> U=3;
>  s = 200*(0.4*U/log(y/10)).^2*y/U/(1+50*x*y/U).^(5/3);

s = 200*(0.4*U/log(y/10))^2*y/U./(1+50*x*y/U).^(5/3);

> return
>
> but when I try to run it, it will show:
> ??? Error using ==> mldivide
> Matrix dimensions must agree.
> I really appreciate if you can help. Im quite new to matlab so there might be some very stupid mistakes inside.....

Best wishes
Torsten.

Subject: Calculating double integral

From: Haojie

Date: 4 Apr, 2012 02:08:16

Message: 3 of 3

Torsten <Torsten.Hennig@umsicht.fraunhofer.de> wrote in message <29cceb7b-9b06-4d61-87bb-a913f60e99dd@l7g2000vbw.googlegroups.com>...
> On 2 Apr., 21:17, "Haojie " <wanghaojie...@gmail.com> wrote:
> > Hi all,
> >
> > I try to calculate the double integral of
> > 200*(0.4*U/log(y/10)).^2*y/U/(1+50*x*y/U).^(5/3)
> > x from 0 to H
> > y from U/l to 10000(or infinity)
> > where U and l are constant H is the input
> >
> > Here is what i wrote
> >
> > function d=SpectrumV(H)
> > U=3;
> > l=1;
> > d=dblquad (@int,0,H,U/l,10000);
> > return
> > function s = int(x,y)
> > U=3;
> >  s = 200*(0.4*U/log(y/10)).^2*y/U/(1+50*x*y/U).^(5/3);
>
> s = 200*(0.4*U/log(y/10))^2*y/U./(1+50*x*y/U).^(5/3);
>
> > return
> >
> > but when I try to run it, it will show:
> > ??? Error using ==> mldivide
> > Matrix dimensions must agree.
> > I really appreciate if you can help. Im quite new to matlab so there might be some very stupid mistakes inside.....
>
> Best wishes
> Torsten.

Thanks for your help. I will try that tomorrow.

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us