To talk on Icrontic, just register!

It only takes 30 seconds.

Have an account? Sign in:

Forgot?
theo23
Getting settled in
theo23
7 Posts

question for integrals

Hi,i have a question about quadgk and i need help.
I have an m-file with name integral which includes this function
function y=integral(E)
y= (1+exp(50000/1293*E+6250000/14223))*exp(-2*(10*E-1228/11)^2)

and one other m-file with this:
Q=quadgk(@integral,0,inf)
When i run it i have the following error.Where is the problem?

??? Error using ==> mpower
Matrix must be square.

Error in ==> integral at 2
y= (1+exp(50000/1293*E+6250000/14223))*exp(-2*(10*E-1228/11)^2)
Error in ==> quadgk>evalFun at 363
fx = FUN(x);

Error in ==> quadgk>f2 at 394
[y,too_close] = evalFun(t2t);

Error in ==> quadgk>vadapt at 275
[fx,too_close] = f(x);

Error in ==> quadgk at 222
[q,errbnd] = vadapt(@f2,interval);

Error in ==> oxi at 1
Q=quadgk(@integral,0,inf)

Thank you!!
shwaip
elaborate bot
shwaip
5,729 Posts
if you want to exponentiate or multiply (or do many other operations) elementwise, you need to use:

Code:
.*
.^
./
etc.

Code:
y= (1+exp(50000/1293*E+6250000/14223)).*exp(-2*(10*E-1228/11).^2)
__________________ my photostream for ic photography challenge

Anyone who wants dropbox, please use my referral link
Similar Threads
Thread Thread Starter Forum Replies Last Post
SLI question Krypto44 General Hardware 1 14 Oct 2006 10:17pm
Matlab help .. problems in finding integrals jaspreet85 Web & Digital Media 8 1 Jun 2006 2:10pm
Radeon 9800 Pro question and case fan question. MushroomJohn General Hardware 1 14 May 2006 2:46am
um...question? naginaoe General Software 2 8 Jan 2006 3:26pm
Wc Kit Question bigtimeballer504 Mods & Cooling 2 20 Jul 2005 5:24am

Go Back   Icrontic Forums > Tech: Software > General Software > Matlab Help
Jump to
This Thread Search this Thread
Search this Thread:

Advanced Search


Current time: 5:51am (GMT)
Powered by vBulletin®
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Get Vanilla instead. Trust me.