- #1
shabby
- 2
- 0
Hello, found this forum very instructive!
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!
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!