shrinking characters with condition

조회 수: 1 (최근 30일)
Mohamuud hassan
Mohamuud hassan 2015년 5월 22일
편집: James Tursa 2015년 5월 22일
hello all; i have limit of 1200 letters, i want to check first, if entering text is less then 250 then don't shrink and direct process it, but if it greater then 250 shrink that into groups and process first 250
  댓글 수: 1
Star Strider
Star Strider 2015년 5월 22일
How do you define a ‘group’? If a ‘group’ is a word, how do you decide what to keep?

댓글을 달려면 로그인하십시오.

채택된 답변

James Tursa
James Tursa 2015년 5월 22일
편집: James Tursa 2015년 5월 22일
E.g., using a for loop to subdivide the entered text string into groups of 250 characters each (is that what you want?):
n = numel(entered_text);
for k=1:250:n
process_text = entered_text(k:min(k+249,n));
% process the string in process_text
end

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Characters and Strings에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by