Display a Matlab struct as a table -
i have struct. want display content of struct table. use following transformation:
atable = struct2table(astruct); disp(atable);
which returns
astruct = localname: {'example.cdf'} size: '1 kb' modifiedtime: '10-may-2010 21:35:00' atable = localname size modifiedtime _____________ ____ ____________ 'example.cdf' 1 kb [1x20 char]
the value of modifiedtime
not correct. hope display value, not array. can tell me how can that?
if string longer 10 chars, display size rather string itself. cellstrings displays string 143 chars , truncates ...
. effect inherited internal call evalc(cellstr)
.
struct2table(struct('char10', '1234567890', 'char11','11234567890','cellstring11',{{repmat('1',1,144)}})) ans = char10 char11 cellstring11 __________ ___________ ________________________________________________________________________________________________________________________________________________ 1234567890 [1x11 char] '111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111…'
to solve issue, once converted table:
atable.modifiedtime = cellstr(atable.modifiedtime);
Comments
Post a Comment