MATLAB Function Reference | ![]() ![]() |
与えられた UI コントロールに対して、適切に改行された文字列行列を出力します。
表示
outstring = textwrap(h,instring) [outstring,position] = textwrap(h,instring)
詳細
outstring = textwrap(h,instring)
は、文字列のセル配列 outstring
を出力します。これはハンドル番号h
の Uicontrol の内部に適合されます。instring
はセル配列で、各セルはテキストの 1 行を含みます。outstring
は、セル配列書式の適切に改行された文字列行列です。入力文字列の各セルは、1 つの段落と考えられます。
[outstring,position]=textwrap(h,instring)
は、Uicontrol の推奨された位置を Uicontrol の単位で出力します。position
は、x と y 方向の複数行テキストの範囲とみなされます。
例題
pos = [10 10 100 10]; h = uicontrol('Style','Text','Position',pos); string = {'This is a string for the uicontrol.', 'It should be correctly wrapped inside.'}; [outstring,newpos] = textwrap(h,string); pos(4) = newpos(4); set(h,'String',outstring,'Position',[pos(1),pos(2),pos(3)+10,pos(4)])
参考
![]() | textread | tic, toc | ![]() |