function cellOfVarStr = expandVar(varStr,include)


if ndims(include)==2
    
    [nRows,nCols] = size(include);
    iElem = 0;
    for iCol = 1:nCols
        for iRow = 1:nRows
            if include(iRow,iCol)
                iElem = iElem + 1;
                cellOfVarStr{1,iElem} = [varStr,'(',num2str(iRow),',',num2str(iCol),')'];
            else
            end
        end

    end
    
elseif ndims(include)==3
    
    [nRows,nCols,nLays] = size(include);
    iElem = 0;
    for iLay=1:nLays
        for iCol = 1:nCols
            for iRow = 1:nRows
                if include(iRow,iCol)
                    iElem = iElem + 1;
                    cellOfVarStr{1,iElem} = [varStr,'(',num2str(iRow),',',num2str(iCol),',',num2str(iLay),')'];
                else
                end
            end
        end
    end
else
end