How can I use MATLAB to plot and sum values using vectors and matrices?

kobjob
Messages
6
Reaction score
0
Hi everyone,

Could someone please tell me how to get MATLAB to do the following seemingly simple task..

j=1:3;
k1=1:3;
m=eye(3)

plot(j,symsum((p8+k1(j)).*m(p8,j),p8,1,3))

or,

k=1:3;
plot(j,sum((k+k1(j)).*m(k,j)))

Thanks for any suggestions,
Kate
 
Physics news on Phys.org
It would probably help if you wrote the question and what you are trying to do.
 
Well k1 is a vector with entries 1 to 3, k1=(1 2 3).
m is the 3 x 3 identity matrix.

For each j, I want to do the sum from k= 1 to 3
sum((k+k1(j)).*m(k,j)) = (1+k1(j))*m(1,j) + (2+k1(j))*m(2,j) + (3+k1(j))*m(3,j)

Then I want to plot the values of the sum for each j.
 
Prove $$\int\limits_0^{\sqrt2/4}\frac{1}{\sqrt{x-x^2}}\arcsin\sqrt{\frac{(x-1)\left(x-1+x\sqrt{9-16x}\right)}{1-2x}} \, \mathrm dx = \frac{\pi^2}{8}.$$ Let $$I = \int\limits_0^{\sqrt 2 / 4}\frac{1}{\sqrt{x-x^2}}\arcsin\sqrt{\frac{(x-1)\left(x-1+x\sqrt{9-16x}\right)}{1-2x}} \, \mathrm dx. \tag{1}$$ The representation integral of ##\arcsin## is $$\arcsin u = \int\limits_{0}^{1} \frac{\mathrm dt}{\sqrt{1-t^2}}, \qquad 0 \leqslant u \leqslant 1.$$ Plugging identity above into ##(1)## with ##u...
Back
Top