フィルターのクリア

Info

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

could anyone help me to solve the issue in the following code

1 回表示 (過去 30 日間)
jaah navi
jaah navi 2019 年 6 月 17 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
code:
particles=10;
users=4;
dimensions=2;
for particle=1:particles
clusters= randi(users,1);
swarm_pos = rand(clusters,dimensions);
DDD=partitions(users,clusters);
total_number_of_partitions = length(DDD);
idx=randperm(total_number_of_partitions,1);
iwant= DDD(idx);
partdisp(iwant)%remains tha same for more than one particle in some cases.But it should be different.
end
When i run the code it executes.But partdisp remains the same for more than one particle in some cases.I actually need to have different partdisp for each and every particle.Could anyone please help me on this
  2 件のコメント
jaah navi
jaah navi 2019 年 6 月 18 日
編集済み: Stephen23 2019 年 6 月 18 日
EDIT: COPYRIGHT code removed. The two functions are available here:
partdisp and partitions are functions when i run the code
it gives the following result
PARTICLE = 1
The formation of clusters {1 3 2}:{1 3} {2}
PARTICLE = 2
The formation of clusters {1 2 3}:{1 2 3}
PARTICLE = 3
The formation of clusters {1 2 3}:{1} {2} {3}
PARTICLE = 4
The formation of clusters {1 2 3}:{1 2 3}
PARTICLE = 5
The formation of clusters {1 2 3}:{1} {2 3}
with respect to the above result for 5 particles the formation of clusters should not be the same
but when i run the code sometimes the formation of clusters remain the same as shown above and sometimes it differs.
Could you please help me on this.
Stephen23
Stephen23 2019 年 6 月 18 日
@jaah navi: do NOT upload copyright code to this forum.

回答 (0 件)

この質問は閉じられています。

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by