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

Basic Integration [ Integration limits ]

Asked by sese on 19 Jul 2013

Hello Guys

Just i am wondering how to solve an integration problem in MATLAB for this equation?? here is the problem below

a= 3.43 int Q*n dr

where n dependent variable on r

Regards

0 Comments

sese

Products

No products are associated with this question.

1 Answer

Answer by Wayne King on 19 Jul 2013
Edited by Wayne King on 19 Jul 2013

Is Q a constant? I'm assuming you mean that n is function of r, like n(r)

Suppose n(r) = r^2 and you want to integrate from [-2,2]

    integral(@(r) r.^2,-2,2)

If you don't have a version of MATLAB with integral(), you have options like trapz()

    r = -2:0.02:2;
    n = r.^2;
    trapz(r,n)

1 Comment

sese on 23 Jul 2013

Q is not constant by the way and the integration is undefined.

Q=a*b; b=X^R; R=10; b=c*r; c=0.801; r=0.1;

BY the way, i have a MATLAB version :) Thank you

Wayne King

Contact us