changeset 18986:96f22d6674c4 stable

Fix incorrect sparse matrix example code in oct-file chapter (bug #41799). * external.txi: Use 1-based indexing in sparse matrix creation example to match SparseMatrix constructor.
author Rik <rik@octave.org>
date Tue, 03 Jun 2014 14:42:00 -0700
parents 322eb69e30ad
children 2dcc4398950d
files doc/interpreter/external.txi
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/doc/interpreter/external.txi
+++ b/doc/interpreter/external.txi
@@ -682,10 +682,10 @@
 ColumnVector cidx (nz);
 ColumnVector data (nz);
 
-ridx(0) = 0; cidx(0) = 0; data(0) = 1; 
-ridx(1) = 0; cidx(1) = 1; data(1) = 2; 
-ridx(2) = 1; cidx(2) = 3; data(2) = 3; 
-ridx(3) = 2; cidx(3) = 3; data(3) = 4;
+ridx(0) = 1; cidx(0) = 1; data(0) = 1;
+ridx(1) = 2; cidx(1) = 2; data(1) = 2;
+ridx(2) = 2; cidx(2) = 4; data(2) = 3;
+ridx(3) = 3; cidx(3) = 4; data(3) = 4;
 SparseMatrix sm (data, ridx, cidx, nr, nc);
 @end group
 @end example