필터 지우기
필터 지우기

how to store all values in one matrix in my code ?

조회 수: 1 (최근 30일)
Matlab111
Matlab111 2014년 12월 4일
댓글: Roja G 2020년 11월 3일
here start's my code see below and run my code after running my code you will get like this
r =
0
All cluster head:
X Y E D
20.8804 50.6459 0.9994 93.2509
66.3680 104.8504 0.9997 33.9800
80.0382 156.6456 0.9996 60.0599
84.6183 125.4252 0.9997 29.7159
84.7459 92.5260 0.9998 16.9867
121.3182 55.9365 0.9997 48.9496
135.9162 22.4920 0.9995 85.4252
147.9776 50.8509 0.9996 68.6840
178.1875 56.5368 0.9994 89.4558
183.0381 54.4672 0.9994 94.7025
189.6740 177.5828 0.9988 118.5770
199.6349 138.7574 0.9991 106.9076
up to r=5, and now i want to access all the values in one matrix like this
AllCH111(1).x1=[135.9162 22.4920 0.9995 85.4252
147.9776 50.8509 0.9996 68.6840
178.1875 56.5368 0.9994 89.4558
183.0381 54.4672 0.9994 94.7025
189.6740 177.5828 0.9988 118.5770
199.6349 138.7574 0.9991 106.9076];
AllCH111(2).x1=[135.9162 22.4920 0.9995 85.4252
147.9776 50.8509 0.9996 68.6840
178.1875 56.5368 0.9994 89.4558
183.0381 54.4672 0.9994 94.7025
189.6740 177.5828 0.9988 118.5770
199.6349 138.7574 0.9991 106.9076];
AllCH111(3).x1=[135.9162 22.4920 0.9995 85.4252
147.9776 50.8509 0.9996 68.6840
178.1875 56.5368 0.9994 89.4558
183.0381 54.4672 0.9994 94.7025
189.6740 177.5828 0.9988 118.5770
199.6349 138.7574 0.9991 106.9076];
like this want to get..and i have tried in my code it's self see last 'for loop'

채택된 답변

Azzi Abdelmalek
Azzi Abdelmalek 2014년 12월 4일
The last for loop of your code is:
for r=1:rmax
AllCH111(r).x1=AllCH1(:,1);
AllCH112(r).y1=AllCH1(:,2);
CHbest1(r).x1=CHbest(:,1);
CHbest2(r).y1=CHbest(:,2);
end
In this loop AllCH1(:,1) is not varying, you need to put this inside the loop where ALLCH1 is varying
  댓글 수: 7
Matlab111
Matlab111 2014년 12월 4일
thanks you sir,
Roja G
Roja G 2020년 11월 3일
Greetings of the day..!
sir i want to know how to connect basestation and cluster head,i want to know the link between ch and bs code.
sir could you please help me.
Thanx in advance.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Matrix Indexing에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by