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 Center および File ExchangeCharacters and Strings についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by