From owner-help-octave at bevo dot che dot wisc dot edu Fri Feb 28 22:56:36 1997 Subject: extending arrays From: "John W. Eaton" To: Dave Comer Cc: help-octave at bevo dot che dot wisc dot edu Date: Fri, 28 Feb 1997 22:54:23 -0600 On 28-Feb-1997, Dave Comer wrote: | Can anyone tell me the Octave quivalen of the following (valid) | Matlab statement: | | dydx = [ 1, dydx ]; | | dydx is a 120 x 1 element array. The idea is to add one element to | the array. When I execute this in octave I get the following: | | octave:29> size(dydx) | ans = | | 120 1 | | octave:30> dydx = [1, dydx]; | error: number of rows must match near line 30, column 12 | error: evaluating assignment expression near line 30, column 6 Are you sure this is valid in MATLAB? With 4.2c, I get: >> a = [1;2] a = 1 2 >> [0,a] ??? All matrices on a row in the bracketed expression must have the same number of rows. >> [0;a] ans = 0 1 2 This also works for Octave. jwe