charge simulation method

how can I choose points from the surface of a circle? how can I subtract each element of a matrix from the other elements of the same matrix?

3 Comments

help me plzzzzzz
You need to clarify your question. What is the surface of a circle? For the second part, could you provide an example?
1) we plot a circle and i need to choose 4 points on it
2) if i've a matrix:
f=[x1 x2 x3]
so
i wanna have:
z=[x1-x2 x1-x3 x2-x1 x2-x3 x3-x1 x3-x2]

Sign in to comment.

 Accepted Answer

f=[1 2 3];
g=bsxfun(@minus,f,f.')
The other question depends on how you plot it and how do you want to choose the point.

4 Comments

the circle that I plot:
theta=linspace(0,2*pi,100);
xcenter=5;
ycenter=1;
radius=4;
x=xcenter+(radius*cos(theta));
y=ycenter+(radius*sin(theta));
plot (x,y,'r')
hold on
That's good! How do you want to choose the 4 points? Randomly?
N=length(x);
m=randperm(N);
m=m(1:4);
x_select=x(m);
y_select=y(m);
plot(x_select,y_select,'b*');
ahmed
ahmed on 22 Dec 2011
if i have this variable
p=[p1 p2 p3;p4 p5 p6]
and i want to differential "p" to "x"
x=points on a circle
????

Sign in to comment.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!