开发者

MATLAB: Center displayed text?

开发者 https://www.devze.com 2023-04-07 21:53 出处:网络
How can I center the text printed by display(\'the text\')? Eg, like the text you get when entering matlab.

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

精彩评论

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