[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Bug in stand-alone example program of section A.3 of the manual
From: |
John W. Eaton |
Subject: |
Re: Bug in stand-alone example program of section A.3 of the manual |
Date: |
Wed, 09 Jan 2008 12:28:15 -0500 |
On 9-Jan-2008, David Bateman wrote:
| José Luis García Pallero wrote:
| > Hi,
| >
| > The code:
| >
| > #include <iostream>
| > #include <octave/oct.h>
| > int
| > main (void)
| > {
| > std::cout << "Hello Octave world!\n";
| >
| > int n = 2;
| > Matrix a_matrix = Matrix (n, n);
| > for (octave_idx_type i = 0; i < n; i++)
| > {
| > for (octave_idx_type j = 0; j < n; j++)
| > {
| > a_matrix(row,column) = (i+1)*10 + (j+1);
| >
| > }
| > }
| > std::cout << a_matrix;
| > return 0;
| > }
| > Has a bug in a_matrix(row,column) = (i+1)*10 + (j+1); because the
| > variables row and column aren't defined. The correct form is:
| > a_matrix(i,j) = (i+1)*10 + (j+1);
|
| Opps... This was a cut and paste from "Coda" and I didn't check it that
| carefully. Patch attached
I applied the patch and checked it in.
To the OP, and everyone else on the lists: if you have a bug to
report, please use the address@hidden list.
Thanks,
jwe