开发者

MATLAB: Center displayed text?

How can I center the text printed by display('the text')?

Eg, like the text you get when entering matlab.

A function to get the width of the current terminal will do to (I'll figur开发者_开发技巧e it out from there).


with a fairly new version of matlab you can do:

sz=get(0, 'CommandWindowSize');
command_line_width = sz(1);

Otherwise, you'll have to use a mex file: see this link http://www.mathworks.com/matlabcentral/newsreader/view_thread/25315

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜