wrap text with disp.
이전 댓글 표시
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
dpb
2014년 8월 17일
AFAIK not automagically -- you would have to inquire for the screen size and I'm not sure under Matlab where that is--probably in there somewhere, but I'm not sure where.
There is the 'wrap lines' preference choice for the command window that does it, but whether there's a way to be less of a bludgeon than somehow mung the user's preferences I don't know.
Maybe a query for "Undocumented Matlab"???
Chad Greene
2014년 8월 18일
편집: per isakson
2015년 9월 24일
Jan
2014년 8월 18일
"it does not seem to work" does not allow the readers to understand, what you observ. Which machine are you using and what happens?
Chad Greene
2014년 8월 18일
per isakson
2014년 8월 18일
With R2013a,64bit,Win7 your example outputs one long line. No word wrap here either. (And no warning or error message.)
dpb
2014년 8월 18일
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...
채택된 답변
추가 답변 (1개)
dpb
2014년 8월 18일
0 개 추천
Seems like reasonable enhancement request -- mayhaps TMW official support can suggest a workaround meanwhile.
카테고리
도움말 센터 및 File Exchange에서 Shifting and Sorting Matrices에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!