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

6 次查看(过去 30 天)
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?

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Argument Definitions 的更多信息

标签

产品

Community Treasure Hunt

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

Start Hunting!

Translated by