From help-octave-request at bevo dot che dot wisc dot edu Wed Feb 4 11:42:44 2004 Subject: Re: error: number of rows must match (2 != 1) ... help From: Pol To: help-octave at bevo dot che dot wisc dot edu Date: Wed, 4 Feb 2004 18:38:34 +0100 Thanks alot, I have put a small ' at the end of each a(x;y) and now it works pretty good =) Thanks again -pol- On Mon, 2 Feb 2004 16:48:38 +0100 Søren Hauberg wrote: > Hi again > I just reread your mail and I just have a question. > > Citat Pol : > > function y=multipath(xx,s); > > > > for i=1:200 > > a(i)=-inf; > > endfor > You can just type > a(1:200) = -inf; > I guess it's faster > > > > > if (strcmp(xx,'st')) > > z=[0]; > > endif > > > > if (strcmp(xx,'ra')) > > z=[0 -4 -8 -12 -16 -20]; > > endif > > > > if (strcmp(xx,'ht')) > > z=[-10 -8 a(2) -6 a(4) -4 a(5) 0 a(7:8) 0 a(10:11) -4 a(13:148) > > -8 > > a(150) -9 a(151:155) -10 a(157:170) -12 a(172:199) -14]; endif > I z supposed to a vector or a matrix. If I just cut paste this code z > becomes a matrix due to the linebreak. If z should be a vector you > should use an ellipsis(this is ...). I can get your code to run by > adding the ellipsis and transposing a. > > Hope this helps > > Soren > > > > ------------------------------------------------------------- > Octave is freely available under the terms of the GNU GPL. > > Octave's home on the web: http://www.octave.org > How to fund new projects: http://www.octave.org/funding.html > Subscription information: http://www.octave.org/archive.html > ------------------------------------------------------------- > ------------------------------------------------------------- Octave is freely available under the terms of the GNU GPL. Octave's home on the web: http://www.octave.org How to fund new projects: http://www.octave.org/funding.html Subscription information: http://www.octave.org/archive.html -------------------------------------------------------------