Hello, found this forum very instructive!(adsbygoogle = window.adsbygoogle || []).push({});

I had this doubt of numerical integration in MATLAB. I have to perform this integration in matlab:

r = 0:0.01:22.5; //necessary because they automatically become lower and upper limits of integration!

theta=0:pi/100:pi; // limits are not to be necessarily these

f = 6.09*r*sin(theta);

expr = besselj(0,f)*r * (1-0.7.*r);

int_ans = trapz(expr,r) // integrating wrt r only..theta must remain like const!

now here matrix dimensions are not agreeing! Should i multiply r.*sin(theta) or r*sin(theta) or r' * sin(theta)??

kindly help in this regarding handling num int with multiple variables

btw i have to plot the final answer wrt theta!!

please help..would be very obliged!

**Physics Forums | Science Articles, Homework Help, Discussion**

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Regarding MATLAB

**Physics Forums | Science Articles, Homework Help, Discussion**