Error on integration

77 Views Asked by At

I'm trying to compute and plot the following integral: $$\int_0^\pi d\theta \int_0^{2\pi} \left( {\cos\theta \sin\theta(x-\sin\theta \cos\phi)\over (1+x^2-2x\sin\theta \cos\phi)^{\large\frac32}}\right)\ d\phi$$

the code I've written is:

x_vec=0:0.01:5;
yvec=(int(int((cos(o)*sin(o)*(x_vec-sin(o)*cos(j)))/((1+x_vec^2 -2*x_vec*sin(o)*cos(j))^(3/2))), j= 0..2*pi), o = 0..pi);

the error I get is:

Error: File: q5.m Line: 2 Column: 88 The expression to the left of the equals sign is not a valid target for an assignment.