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?

 Risposta accettata

MyVariable=evalc('disp(MyThingToShow)')

2 Commenti

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

Accedi per commentare.

Più risposte (2)

Categorie

Richiesto:

il 6 Mag 2011

Risposto:

Jan
il 28 Lug 2021

Community Treasure Hunt

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

Start Hunting!

Translated by