From help-octave-request at bevo dot che dot wisc dot edu Mon Feb 2 09:35:12 2004 Subject: Re: error: number of rows must match (2 != 1) ... help From: =?iso-8859-1?b?U/hyZW4=?= Hauberg To: Pol Cc: help-octave at bevo dot che dot wisc dot edu Date: Mon, 2 Feb 2004 16:48:38 +0100 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 -------------------------------------------------------------