From: Paul on 5 Aug 2010 15:34 "us " <us(a)neurol.unizh.ch> wrote in message <i3f2tp$sbs$1(a)fred.mathworks.com>... > "Paul " <unicybsatr(a)gmail.com> wrote in message <i3f1ag$gfu$1(a)fred.mathworks.com>... > > Walter Roberson <roberson(a)hushmail.com> wrote in message <i3evuf$khb$1(a)canopus.cc.umanitoba.ca>... > > > Paul wrote: > > > > > > > Suppose, I have integral I(t)=int from 0 to inf x^-2 > > > > (1-0.8*i*t*x)^-5*erfc(1-logx/5)dx > > > > Function > > > > dblquad is used to calculate int from 0 to inf I(t)dt > > > > But how can I use it to calculate int from 0 to inf I(t)*I(t)dt ? > > > > Do I need here nested handles? If yes, then how should I apply them? > > > > > > I2 = @(t) I(t).^2; > > > > > > and dblquad I2 > > > > > > > > > Questions: > > > > > > - Is that log(x/5) or log(x)/5 ? > > > > > > - Is your log base 10 or natural log? > > > > > > - Is the 0.8 intended to be equivalent to 4/5 ? > > > > > > I am attempting some symbolic transforms to see if I can derive a nicer > > > function, but when you start doing symbolic transforms, 4/5 versus 0.8 makes a > > > difference, especially if the coefficient turns up as an exponent. > > > > Hello thanks for answer. > > I2 = @(t) I(t).^2; > > dblquad I2 > > > > But how are you define I ? > > a hint: > - the var I must live in the workspace when you create the function handle... > > us can you give me the code, not hint. I=@(x,t) x^-2*...... ?
From: Walter Roberson on 5 Aug 2010 15:44 Paul wrote: > "us " <us(a)neurol.unizh.ch> wrote in message > <i3f2tp$sbs$1(a)fred.mathworks.com>... >> "Paul " <unicybsatr(a)gmail.com> wrote in message >> <i3f1ag$gfu$1(a)fred.mathworks.com>... >> > Walter Roberson <roberson(a)hushmail.com> wrote in message >> <i3evuf$khb$1(a)canopus.cc.umanitoba.ca>... >> > > Paul wrote: >> > > > > > Suppose, I have integral I(t)=int from 0 to inf x^-2 > > > >> (1-0.8*i*t*x)^-5*erfc(1-logx/5)dx >> > > > Function >> > > > dblquad is used to calculate int from 0 to inf I(t)dt >> > > > But how can I use it to calculate int from 0 to inf I(t)*I(t)dt ? >> > > > Do I need here nested handles? If yes, then how should I apply >> them? >> > > > > I2 = @(t) I(t).^2; >> > > > > and dblquad I2 >> > > > > > > Questions: >> > > > > - Is that log(x/5) or log(x)/5 ? >> > > > > - Is your log base 10 or natural log? >> > > > > - Is the 0.8 intended to be equivalent to 4/5 ? >> > > > > I am attempting some symbolic transforms to see if I can >> derive a nicer > > function, but when you start doing symbolic >> transforms, 4/5 versus 0.8 makes a > > difference, especially if the >> coefficient turns up as an exponent. >> > > Hello thanks for answer. >> > I2 = @(t) I(t).^2; >> > dblquad I2 >> > > But how are you define I ? >> a hint: >> - the var I must live in the workspace when you create the function >> handle... >> >> us > can you give me the code, not hint. > I=@(x,t) x^-2*...... ? Take the function handle you have now for dblquad'ing x^-2 <etc> and wrap another handle around it that takes the same parameters and calls the first handle and squares the result.
From: Paul on 5 Aug 2010 16:11 Walter Roberson <roberson(a)hushmail.com> wrote in message <i3f4bk$r8e$1(a)canopus.cc.umanitoba.ca>... > Paul wrote: > > "us " <us(a)neurol.unizh.ch> wrote in message > > <i3f2tp$sbs$1(a)fred.mathworks.com>... > >> "Paul " <unicybsatr(a)gmail.com> wrote in message > >> <i3f1ag$gfu$1(a)fred.mathworks.com>... > >> > Walter Roberson <roberson(a)hushmail.com> wrote in message > >> <i3evuf$khb$1(a)canopus.cc.umanitoba.ca>... > >> > > Paul wrote: > >> > > > > > Suppose, I have integral I(t)=int from 0 to inf x^-2 > > > > >> (1-0.8*i*t*x)^-5*erfc(1-logx/5)dx > >> > > > Function > >> > > > dblquad is used to calculate int from 0 to inf I(t)dt > >> > > > But how can I use it to calculate int from 0 to inf I(t)*I(t)dt ? > >> > > > Do I need here nested handles? If yes, then how should I apply > >> them? > >> > > > > I2 = @(t) I(t).^2; > >> > > > > and dblquad I2 > >> > > > > > > Questions: > >> > > > > - Is that log(x/5) or log(x)/5 ? > >> > > > > - Is your log base 10 or natural log? > >> > > > > - Is the 0.8 intended to be equivalent to 4/5 ? > >> > > > > I am attempting some symbolic transforms to see if I can > >> derive a nicer > > function, but when you start doing symbolic > >> transforms, 4/5 versus 0.8 makes a > > difference, especially if the > >> coefficient turns up as an exponent. > >> > > Hello thanks for answer. > >> > I2 = @(t) I(t).^2; > >> > dblquad I2 > >> > > But how are you define I ? > >> a hint: > >> - the var I must live in the workspace when you create the function > >> handle... > >> > >> us > > can you give me the code, not hint. > > I=@(x,t) x^-2*...... ? > > Take the function handle you have now for dblquad'ing x^-2 <etc> > and wrap another handle around it that takes the same parameters and calls the > first handle and squares the result. I tried this code: (function x*y^2) And integration from 0 to 1: I=@(x,y) x.^2*y; I2=@(y) I(y).^2; dblquad(I2,0,1,0,1); But it's not working. ??? Error using ==> @(y) I(y).^2 Too many input arguments. Please help!!!
From: Walter Roberson on 5 Aug 2010 16:39 Paul wrote: > I tried this code: (function x*y^2) > And integration from 0 to 1: > I=@(x,y) x.^2*y; > I2=@(y) I(y).^2; > dblquad(I2,0,1,0,1); Does that match what I said, >> Take the function handle you have now for dblquad'ing x^-2 <etc> >> and wrap another handle around it that takes the same parameters and calls >> the first handle and squares the result. Does your I2 have the *same* parameters as your I ? I = @(x,y) x.^2*y; I2 = @(x,y) I(x,y).^2; dblquad(I2,0,1,0,1) ans = 0.0666666666666667
From: Paul on 5 Aug 2010 16:50 Walter Roberson <roberson(a)hushmail.com> wrote in message <i3f7j2$35a$1(a)canopus.cc.umanitoba.ca>... > Paul wrote: > > > I tried this code: (function x*y^2) > > And integration from 0 to 1: > > I=@(x,y) x.^2*y; > > I2=@(y) I(y).^2; > > dblquad(I2,0,1,0,1); > > Does that match what I said, > > >> Take the function handle you have now for dblquad'ing x^-2 <etc> > >> and wrap another handle around it that takes the same parameters and calls > >> the first handle and squares the result. > > Does your I2 have the *same* parameters as your I ? > > > > I = @(x,y) x.^2*y; > I2 = @(x,y) I(x,y).^2; > dblquad(I2,0,1,0,1) > > ans = > 0.0666666666666667 Thanks!!!!!
First
|
Prev
|
Next
|
Last
Pages: 1 2 3 Prev: Java versions in Matlab Next: switching aroundiing a matrix |