MATLAB: ??? Input argument “A” is undefined. in the following code of Apriori!

??? input argument "a" is undefined error message in the apriori code

function S=GetNonTrivialSubsets(A)
n=numel(A);
S=cell(2^n-2,1);
for i=1:numel(S)
f=dec2binvec(i);
f=[f zeros(1,n-numel(f))]; %#ok
S{i}=A(logical(f));
end
end

Best Answer

You need to call the function GetNonTrivialSubsets with an input argument, like this:
>> X = [1,2,1];
>> GetNonTrivialSubsets(X)
ans =
[ 1]
[ 2]
[1x2 double]
[ 1]
[1x2 double]
[1x2 double]
Very basic MATLAB usage like this is taught very well in the introductory tutorials. All beginners should do them: