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

ahmed
ahmed 2011년 12월 8일
help me plzzzzzz
Fangjun Jiang
Fangjun Jiang 2011년 12월 8일
You need to clarify your question. What is the surface of a circle? For the second part, could you provide an example?
ahmed
ahmed 2011년 12월 8일
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]

댓글을 달려면 로그인하십시오.

 채택된 답변

Fangjun Jiang
Fangjun Jiang 2011년 12월 8일

0 개 추천

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

ahmed
ahmed 2011년 12월 9일
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
Fangjun Jiang
Fangjun Jiang 2011년 12월 9일
That's good! How do you want to choose the 4 points? Randomly?
Fangjun Jiang
Fangjun Jiang 2011년 12월 9일
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 2011년 12월 22일
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
????

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

질문:

2011년 12월 8일

Community Treasure Hunt

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

Start Hunting!

Translated by