The code is ok for input_cell= {'ABC','ACB','BCA'}
The code can not run for input_cell= {'ABC','ACB','BCAD'}
Can anyone help me to fix this error please?
input_cell= {'ABC','ACB','BCAD'}
%the code is ok for input_cell= {'ABC','ACB','BCA'}
data=[];
for i=1:numel(input_cell)
p=strsplit(input_cell{i},' ')
m=cell2mat(p(:))
m=m-'?'
[~,k]=sort(m);
%compare each pair
M = bsxfun(@(a,b)(a<b)+0.5*(a==b),k,k')
vector = reshape(M.',[],1) %# Collect the row contents into a column vector
vector = vector' % change from columns into 1 row
data(i,:)= vector % data matrix inludes all vectors
end
strsplitdo - Abr001am