# HG changeset patch # User Jordi GutiƩrrez Hermoso # Date 1283194147 18000 # Node ID 873e199ac5e50157dd88eac10b60f6989ff59cc7 # Parent 4c1ffaed8caaf06c7ba6abe7bf3b7b2ff8af4397 Explain that ranges in vectors do get expanded diff -r 4c1ffaed8caa -r 873e199ac5e5 doc/ChangeLog --- a/doc/ChangeLog Mon Aug 30 11:05:00 2010 -0400 +++ b/doc/ChangeLog Mon Aug 30 13:49:07 2010 -0500 @@ -1,3 +1,7 @@ +2010-08-30 Jordi GutiƩrrez Hermoso + * interpreter/numbers.txi: Explain that ranges in vectors do get + expanded. + 2010-08-15 Rik * interpreter/matrx.txi: Add documentation for randi function. diff -r 4c1ffaed8caa -r 873e199ac5e5 doc/interpreter/numbers.txi --- a/doc/interpreter/numbers.txi Mon Aug 30 11:05:00 2010 -0400 +++ b/doc/interpreter/numbers.txi Mon Aug 30 13:49:07 2010 -0500 @@ -393,6 +393,24 @@ This allows you to write a constant like @samp{1 : 10000} without using 80,000 bytes of storage on a typical 32-bit workstation. +A common example of when it does become necessary to convert ranges into +vectors occurs when they appear within a vector (i.e. inside square +brackets). For instance, whereas + address@hidden +x = 0 : 0.1 : 1; address@hidden example + +defines @var{x} to be a variable of type @code{range} and occupies 24 +bytes of memory, the expression + address@hidden +y = [ 0 : 0.1 : 1]; address@hidden example + +defines @var{y} to be of type @code{matrix} and occupies 88 bytes of +memory. + Note that the upper (or lower, if the increment is negative) bound on the range is not always included in the set of values, and that ranges defined by floating point values can produce surprising results because