Info
Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.
could anyone help me to solve the issue.
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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 Kommentare
Walter Roberson
am 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} ?
Antworten (0)
Diese Frage ist geschlossen.
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!