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
精彩评论