wrap text with disp.

5 visualizzazioni (ultimi 30 giorni)
Chad Greene
Chad Greene il 17 Ago 2014
Modificato: per isakson il 24 Set 2015
The error command wraps text to fit the width of the command window, but disp does not. I know I can put in hard-wired new lines with disp, but I do not want to assume that a user's command window is N characters wide. Is there a way to let text fit the command window dynamically as it does with error?
  6 Commenti
per isakson
per isakson il 18 Ago 2014
With R2013a,64bit,Win7 your example outputs one long line. No word wrap here either. (And no warning or error message.)
dpb
dpb il 18 Ago 2014
No joy w/ R2012b on XP, either. Interestingly enough,
>> com.mathworks.services.Prefs.getBooleanPref('CommandWindowWrapLines')
ans =
0
>> com.mathworks.services.Prefs.setBooleanPref('CommandWindowWrapLines',1)
>> com.mathworks.services.Prefs.getBooleanPref('CommandWindowWrapLines')
ans =
1
>>
Does make it appear there is such a option but whatever it does, disp "knows nuthnk!" about it...

Accedi per commentare.

Risposta accettata

Chad Greene
Chad Greene il 23 Set 2015
I ended up writing a function for this called wraptext.

Più risposte (1)

dpb
dpb il 18 Ago 2014
Seems like reasonable enhancement request -- mayhaps TMW official support can suggest a workaround meanwhile.

Categorie

Scopri di più su Shifting and Sorting Matrices in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by