Info
이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.
how to identify the user number with respect to the following code in the attached graph.
조회 수: 1 (최근 30일)
이전 댓글 표시
clear all;
clc;
user=2
subcarrier=4
for t = 1:length(user)
radius=3
X=ones(1,user(t))
Y=ones(1,user(t))
R=radius*(rand(1,user(t)))
th = 0:pi:2*pi
X1=X+R
Y1=Y+R
xaxis = radius * cos(th)
yaxis = radius * sin(th)
figure
plot(xaxis, yaxis)
hold on
plot(Y,X,'r^')
hold on
plot(Y1,X1,'ko')
hold on
c=2*pi
for r = 1:length(subcarrier)
for j=1:user(t)
temp=[];
for n=1:subcarrier(r)
nc=(n-1)*c;
entry=(1+i*nc)/(1+nc^2);
temp=[temp entry]
end
G=randn(subcarrier(r),1)+i*randn(subcarrier(r),1)
H=abs(G)
figure
plot(abs(H),'-*')
hold on
end
end
end
The above code executes and gives me the attached graph.
From the fig 1 how to identify which is user 1 and user 2.
and from fig2 and fig 3 which is for user 1 and user 2.
댓글 수: 1
Rik
2019년 1월 15일
Your code is really confusing, because it lacks comments about what it should be doing. You also don't explain what it is you mean. We are not mind readers, you need to explain these things. This is not your first question.
There are also numerous issues in this code. The debugging tools are really valuable, try to use them. Because of the many times you omit the semicolon, it is not visible at a glance if there are any other issues that were automatically detected.
One of the things you are missing now is that you're using j as a loop index, but then use i in your code. I don't know if that is an error, but it seems odd you wouldn't be using your loop index variable for anything. Avoid i and j as variables to avoid any ambiguity and use 1i to generate the complex unit value.
답변 (0개)
이 질문은 마감되었습니다.
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!