필터 지우기
필터 지우기

How to I disable truncation of long strings in structs in command window?

조회 수: 2 (최근 30일)
Lukas
Lukas 2015년 4월 9일
댓글: Thomas Koelen 2015년 4월 9일
Hello,
I am on Matlab R2014a (8.3.0.532, glnxa64). Whenever I have a long string as a struct member and let it display on the command window, I get a truncated version of it. How do I disable this "feature"?
Example:
>> myStruct.myFieldname = repmat('A', 1, 100)
myStruct =
myFieldname: 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...'

답변 (1개)

Thomas Koelen
Thomas Koelen 2015년 4월 9일
편집: Thomas Koelen 2015년 4월 9일
myStruct.myFieldname = repmat('A', 1, 100);
fprintf(myStruct.myFieldname)
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
:D
edit:
Just typing
myStruct.myFieldname
also showed me the whole string.
  댓글 수: 2
Lukas
Lukas 2015년 4월 9일
This is a valid workaround. Unfortunately, it is impractical when `myStruct` has many fields. Do you have an alternative?
Thomas Koelen
Thomas Koelen 2015년 4월 9일
What exactly are you trying to do? Could you explain so I can be of better help!

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

카테고리

Help CenterFile Exchange에서 Data Type Conversion에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by