[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: error: number of rows must match (2 != 1) ... help
From: |
Søren Hauberg |
Subject: |
Re: error: number of rows must match (2 != 1) ... help |
Date: |
Mon, 2 Feb 2004 16:48:38 +0100 |
User-agent: |
Internet Messaging Program (IMP) 4.0-cvs |
Hi again
I just reread your mail and I just have a question.
Citat Pol <address@hidden>:
> 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
-------------------------------------------------------------