Here is an integral (similar in form to the one) I want to evaluate:(adsbygoogle = window.adsbygoogle || []).push({});

[tex]\int_{r_1}^{r_2}R \left\vert{\int_{x_1}^{x_2}Y(x,R) dx \right\vert^2 dR[/tex]

This is my approach - please correct me because I don't think it's right:

I treat R as a constant and evaluate the inner integral over some vector of x (using the function "trapz" in MATLAB)

I do the same thing again for another value of R (until the range of R values are done). Ending up with an array of values for the inner integral. (Where each element corresponds to the integral of a particular value of R).

Lastly, I evaluate the outer integral (with "trapz") over the same vector of R but foreachvalue of the inner integral.

What do you think?

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

Dismiss Notice

Join Physics Forums Today!

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

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

# MATLAB Need Help with Numerical Integration in MATLAB

Can you offer guidance or do you also need help?

Draft saved
Draft deleted

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