MATLAB: Could anyone help me to solve the issue in the following code

display

code:
X=[3]
for t=1:length(X)
A = partitions([X(t)])
for d=1:length(A)
for e=1:length(A{d})
C=A{d}{e}
end
end
end
If i run the code,it executes and gives the result.
C = 1 2 3
C = 1 2
C = 3
C = 1 3
C = 2
C = 1
C = 2 3
C = 1
C = 2
C = 3
But i want to have C should not display more than 2 numbers,which means
C should display
C = 1 2
C = 3
C = 1 3
C = 2
C = 1
C = 2 3
C = 1
C = 2
C = 3
by not considering C=1 2 3.
Could anyone please help me on this.

Best Answer

X=[3]
for t=1:length(X)
A = partitions([X(t)])
for d=1:length(A)
if length(A{d})>1
for e=1:length(A{d})
C=A{d}{e}
end
end
end
end