Clear Filters
Clear Filters

Info

This question is closed. Reopen it to edit or answer.

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

1 view (last 30 days)
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.

Answers (0)

This question is closed.

Community Treasure Hunt

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

Start Hunting!