Info

この質問は閉じられています。 編集または回答するには再度開いてください。

could anyone help me with the following code

1 回表示 (過去 30 日間)
Prabha Kumaresan
Prabha Kumaresan 2018 年 7 月 24 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
code:
user=[4 8]
R=[2 3 ]
Xmax=1
Ymax=1
for t = 1:length(user)
figure();
axh = axes();
hold(axh, 'on')
for i = 1:length(R)
radius = R(i)
xsd=ones(1,length(user))*Xmax
ysd=ones(1,length(user))*Ymax
rrx=radius*sqrt(rand(1,user(t)))
thetarx=2*pi*rand(1,user(t))
xrx=xsd+rrx.*cos(thetarx)
yrx=ysd+rrx.*sin(thetarx)
th = 0:pi/100:2*pi
xunit = radius * cos(th) + Xmax
yunit = radius * sin(th) + Ymax
plot(axh, xunit, yunit)
plot(axh, ysd,xsd,'r^')
plot(axh, yrx,xrx,'ko')
axis equal
end
end
The code executes,but it doesnt give the result what i actually need.I actually need the following graph as stated in fig 1 and 2.Fig 1 is for 2 user and fig 2 is for 4 user.when i run the code i am getting the graph as stated in fig 3 and fig 4.could anyone help me how to get fig1 and fig2 instead of fig 3 and fig 4.
  2 件のコメント
Jan
Jan 2018 年 7 月 24 日
It is easier to see, if you post screenshots instead of figures.
Adam Danz
Adam Danz 2018 年 7 月 24 日
編集済み: Adam Danz 2018 年 7 月 24 日
Duplicate.
Prabha, if you attach your figures to your original question using screen shots or save them as jpg (as Jan suggested), it will be helpful. But please don't post duplicate questions.

回答 (0 件)

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by