MATLAB: How to count repeated character in string ? count repeated character string loke this aaaaddccccfeeee how to count the repeating of character (a) a=3 Best Answer str='aaaaddccccfeeee'[ii,jj,kk]=unique(str)freq=histc(kk,1:numel(ii))c=regexp(ii,'.','match')'out=[c num2cell(freq)] Related SolutionsMATLAB: Rank keywords using length [~,il]=sort(l,'descend'); K>> s(il)ans = 16×1 cell array {'third-greatest'} {'humanitarian' } {'Brussels' } {'Ixelles,' } {'British' } {'Hepburn' } {'actress' } {'fashion' } {'Audrey' } {'dancer' } {'female' } {'legend' } {'screen' } {'model' } {'film' } {'icon' }K>> MATLAB: How to count number of words in a text file A={'HJK.BT' 'KLP.OK' 'HJK.BT' 'POL.ST' 'HJK.BT' 'POL.ST'}[ii,jj,kk]=unique(A)freq=accumarray(kk,1)out=[ii num2cell(freq)] Related QuestionShowing x and y Labels in a Correlation Matrix PlotString of binary to letters?How to make a log operation for a matrix excluding the ‘-inf’ values
Best Answer