UI tweak - Suppress abbreviation of long strings in command window

조회 수: 2 (최근 30일)
When I am using matlab interactively to deal with cell arrays of strings, I often find long strings get abbreviated to display e.g. '[1x73 char]' instead of the contents of the string.
The length of string to trigger abbreviation seems to depend on the width of the command window but is not straightforward (e.g. my current command window is 120 characters wide, but a 73-character string is still getting abbreviated). Is there a way to control this behavior and/or suppress it entirely?
Obviously I can still extract the contents of a cell by direct query, but I'd like to see a set of results in an array.
example:
>> U.Rows(140:144,:)
ans =
'325910' 'Printing ink manufacturing'
'3259A0' 'All other chemical product and preparation manufacturing'
'326110' [1x73 char]
'326121' 'Unlaminated plastics profile shape manufacturing'
'326122' 'Plastics pipe and pipe fitting manufacturing'
>>

채택된 답변

Jan
Jan 2012년 3월 16일
You can create an individual display function inside a @cell folder. But this is not trivial, because the cell elements can habe different types and sizes.
I'm using dedicated fprintf('%s\n', C{:}) commands to display cell strings without this magic abbrevs.
  댓글 수: 1
Brandon Kuczenski
Brandon Kuczenski 2012년 3월 17일
Thanks- I didn't realize I could create a 'local' @cell folder for use in the current directory- useful trick!

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Foundation and Custom Domains에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by