MATLAB: I want to solve this problem MATLAB I want find common subsequence numers Best Answer This is wildly too confusing of a question. It LOOKS like you are trying to find subsequences of any given array that increment by exactly 1.That simple requires you to find blocks of ones when you form the diff of an array. Thus...A=[15,14,16,10,6,1,2,8,9,10];dA = diff(A) == 1dA = 0 0 0 0 0 1 0 1 1So there is a subsequence of length 2 and another of length 3 in string A.start_A = strfind([0,dA,0],[0 1])start_A = 6 8end_A = strfind([0,da,0],[1 0])end_A = 7 10 Related SolutionsMATLAB: Apply all steps in whole data set. You need to make up a cell reference with the row and column you want the data to go into. For examplecellReference = sprintf('A%d', row);xlswrite(fullFileName, data, sheetName, cellReference); MATLAB: How to find elements in sequence in an array v=[2,3,6,8,9,10,12,14,16,17]id=[10 diff(v) 10]==1ii1=strfind(id,[0 1])ii2=strfind(id,[ 1 0]) Related QuestionHow to reverse a subarray of an arrayI was trying to solve this problem but it is showing error like??? “Attempt to reference field of non-structure array..”i am not able to find the erro ..please helpSolving system of non linear equationsFinding series of repeating numbers in matrix
Best Answer