string3=TrajSimilarity(1,3).aLongestString; string4=TrajSimilarity(1,4).aLongestString; [D,dist,aLongestString]=LCS(string3,string4); U=numel(regexp(string3,'(\(\d+\)|\d)')); V=numel(regexp(string4,'(\(\d+\)|\d)')); nLCS=numel(regexp(aLongestString,'(\(\d+\)|\d)')); ratioU=nLCS/U; ratioV=nLCS/V; EA = (ratioU + ratioV)/2; WA = (U*ratioU+V*ratioV)/(U+V);
LCS is a function that calculates the longest common substring between two strings (if can be helpful, I will post a link with it). I have problems to create an optimized code that compare the longest common sequence of the first user with the others, the longest common sequence of the second user with the others and etc. I try this code:
for k=1:14 string3=TrajSimilarity(1,k).aLongestString; for j=2:14 string4=TrajSimilarity(1,j).aLongestString; [A(k,j).D,A(k,j).dist,A(k,j).aLongestString]=LCS(string3,string4); end end
but it generates error:
Attempted to access L(0,0); index must be a positive integer or logical. Error in LCS (line 52) dist = L(n,m); Error in Prova1 (line 6) [A(1,k).D,A(1,k).dist,A(1,k).aLongestString]=LCS(string3,string4);
Can you give me an help?
Matlabsolutions.com provides guaranteed satisfaction with a
commitment to complete the work within time. Combined with our meticulous work ethics and extensive domain
experience, We are the ideal partner for all your homework/assignment needs. We pledge to provide 24*7 support
to dissolve all your academic doubts. We are composed of 300+ esteemed Matlab and other experts who have been
empanelled after extensive research and quality check.
Matlabsolutions.com provides undivided attention to each Matlab
assignment order with a methodical approach to solution. Our network span is not restricted to US, UK and Australia rather extends to countries like Singapore, Canada and UAE. Our Matlab assignment help services
include Image Processing Assignments, Electrical Engineering Assignments, Matlab homework help, Matlab Research Paper help, Matlab Simulink help. Get your work
done at the best price in industry.