MATLAB: Could anyone help me to overcome the error in the following code

error stating unbalanced or unexpected parenthesis or bracket

code:
X=[3];
for t=1:length(X)
A = partitions([X(t)]);
for d=1:length(A)
for e=1:length(A{d})
if (size(A{d}{e})<= 2)
C=A{d}{e}
else
C=A[]
end
end
end
end
If i run the above code its showing error stating Unbalanced or unexpected parenthesis or bracket in line C=A[].Could anyone help me how to overcome the error.

Best Answer

C = A[] ;
The above is invalid....If A is a array specify the index like A(1) etc..or if A is a cell use A{1} like this.
Related Question