jeanluct / braidlab

Matlab package for analyzing data using braids
GNU General Public License v3.0
23 stars 9 forks source link

Wrap long braids and loops #44

Closed jeanluct closed 9 years ago

jeanluct commented 9 years ago

Currently long braids are not wrapped:

#!matlab

>> b=braid('random',10,100)

b = 

< 2  8 -3  5  2 -6 -3  6  7  7 -5  1  3 -9  2 -8 -5  9  1  4  1 -9  1  7  8  8  1 -4  3 -8  4 -9 -2 -3 -2  2  8 -6  5 -2 -8 -6  4  5 -4 -1 -3  2  2  3 -4  1  9 -9 -5 -5  4 -9  4 -2  8 -4  3  4  1  2  9 -9 -6 -1  3 -4  8 -1  1 -2 -6 -7  6 -5 -5  3  7  2  7 -2  4  6 -8  1 -9 -7  5  4  5 -3  5 -5 -8 -8 >
>> l=loop(100)

l = 

(( 0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 ))

Probably they should be? The output should follow the setting of format loose or format compact. We need to know the display width to do that.

We can get the current window size with

#!matlab

>> get(0, 'CommandWindowSize')
ans =
    88    37

See also the command textwrap.

jeanluct commented 9 years ago

From Jean-Luc Thiffeault on 2014-02-12 14:47:09+00:00

Query format:

#!matlab

>> get(0,'Format')
ans =
short
>> get(0,'FormatSpacing')
ans =
compact
jeanluct commented 9 years ago

From Jean-Luc Thiffeault on 2014-02-12 15:40:01+00:00

Wrap output for braids and loops. Resolves issue #44.

→ <<cset 42bc1e4d8d86>>