Info

此问题已关闭。 请重新打开它进行编辑或回答。

could anyone help me how to avoid repetition of the same number of clusters

2 次查看(过去 30 天)
I am having totally 4 users in my system with respect to the following code:
meas=[1 2;
3 4;
5 6;
7 8]
particles = 2;
iterations =2;
for t=1:iterations
for p=1:particles
cluster=size(meas,1)
clusters= randi(cluster,1,1)
D=partitions(cluster,clusters)
total_number_of_partitions = length(D)
idx=1
B = D(idx)
partdisp(B)
end
end
When i run the code it executes and gives the number and formation of clusters for each particle on every iteration.
But sometimes it display the same set of clusters on different iteration.
As i have used idx=1 i think it displays the same set of clusters.could anyone please help me how to modify it such that the set of clusters needs to be changed on each and every iteration with respect to each particle.

回答(0 个)

此问题已关闭。

Community Treasure Hunt

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

Start Hunting!

Translated by