Info
This question is closed. Reopen it to edit or answer.
could anyone help me to solve the issue.
1 view (last 30 days)
Show older comments
code:
A=partitions(4)
partdisp(A)
where partitions and partdisp are functions
when i run the above code it executes and gives the following result
The formation of clusters {1 2 3 4}:
{1 2 3 4}
{1 2 3} {4}
{1 2 4} {3}
{1 2} {3 4}
{1 2} {3} {4}
{1 3 4} {2}
{1 3} {2 4}
{1 3} {2} {4}
{1 4} {2 3}
{1} {2 3 4}
{1} {2 3} {4}
{1 4} {2} {3}
{1} {2 4} {3}
{1} {2} {3 4}
{1} {2} {3} {4}
with respect to the result i need to avoid the formation which contains {2 3},{2,4},{3,4}.
Could anyone please help me on it.
4 Comments
Walter Roberson
on 11 Sep 2019
Remove the entries of A that would meet those conditions before you do the partdisp()
The partitions code returns a cell array row vector (one column). Each row is a cell array with possibly multiple entries. So for example for row K, A{K} would be a cell array whose entries are each a subset.
Given one particular partitioning expressed as a cell array, how would you test whether it has an entry which is {2,3}, {2,4}, or {3,4} ?
Answers (0)
This question is closed.
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!