OOzy Pal
OOzy Pal

Reputation: 125

Text Wrap in Matlab Command Windows

How can I wrap text in Matlab Command Windows? How Can I know the command windows width/size so I can write a function to wrap up my text.

Upvotes: 0

Views: 1073

Answers (3)

TTT
TTT

Reputation: 1205

As Suever pointed out, you can do get(0,'CommandWindowSize) to get the dimensions of the command window. There's an option to enable wrapping of the command window, which I believe satisfies what you're trying to do. enter image description here

Upvotes: 1

Suever
Suever

Reputation: 65430

You can get the current width of the command window by using the CommandWindowSize property of the graphics root object.

sz = get(0, 'CommandWindowSize');
%   80  25

The first value in this matrix is the number of columns and the second number is the number of rows.

After knowing this size, you can then either write your own wrapping function or use the second one that Mikhail_Sam linked to.

Upvotes: 0

Mikhail_Sam
Mikhail_Sam

Reputation: 11218

There is no built in functions for this. But I interested in your question and found some workarounds about this:

  1. Function to control command window - useful module with a lot of different functions. It contains Position: Set/get position relative to monitor options.
  2. One more MATLAB module to wrap text.

I want to add, that I'm not the author of this functions! Just found it!

Upvotes: 0

Related Questions