Save disp output as a string/cell variable

The command disp(x) does a reasonable job of displaying variables of any class. For example, it expands structures to show their fields and values. Is it possible to capture this formatted output as a variable?

 采纳的回答

MyVariable=evalc('disp(MyThingToShow)')

2 个评论

Look at that, there is a use for eval (well evalc ...).
the spy function without arguments is better :)

请先登录,再进行评论。

更多回答(2 个)

类别

帮助中心File Exchange 中查找有关 Variables 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by