From help-octave-request at bevo dot che dot wisc dot edu Mon Feb 2 08:35:38 2004 Subject: error: number of rows must match (2 != 1) ... help From: Pol To: help-octave at bevo dot che dot wisc dot edu Date: Mon, 2 Feb 2004 15:33:33 +0100 Hi there, Many teachers is getting interested in octave in my school and one of them gave me a bunch of m file about signal processing to translate to Octave. I already converted many of those file but I'm blocked in that script: function y=multipath(xx,s); for i=1:200 a(i)=-inf; endfor 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 if (strcmp(xx,'tu')) z=[-4 -3 a(3) 0 a(5) -2.6 a(7:8) -3 a(10:11) -5 a(13) -7 a(14:17) -5 a(19:23) -6.5 a(25:31) -8.6 -11 a(34:50) -10];%else % disp('mauvaise entrée'); endif m_tra=10.^(z/10); y=filter(m_tra,1,s); plot (y) endfunction That script is called from that script: ------8<-------- nbsymbols=input ('entrez le nombre de symboles: \n'); x=input('entrez le type de trajet: ','s'); snr=input('entrez le rapport S/N : '); seq=data_gen3(nbsymbols); mod=modulation(seq); rot=rotation(mod); filtre=fgauss(rot); trajets=multipath(x,filtre); bruit=noise(trajets,snr); trajetbruit=bruit+trajets; plot(trajetbruit) ------8<-------- now, this is the execution: octave:1> progbruit entrez le nombre de symboles: 1000 entrez le type de trajet: ht entrez le rapport S/N :15 1 0 0 0 1 0 0 1 0 1 1 1 0 0 0 0 1 1 1 1 0 1 1 0 0 1 0 0 1 0 1 1 0 0 1 1 0 0 0 1 0 0 ... 1 0 1 1 0 0 1 0 1 0 1 0 error: number of rows must match (2 != 1) near line 21, column 37 error: evaluating assignment expression near line 21, column 5 error: evaluating if command near line 20, column 1 error: called from `multipath' in file `/home/pol/.octave/m/edge/multipath.m' error: evaluating assignment expression near line 12, column 9 error: near line 12 of file `/home/pol/.octave/m/edge/progbruit.m' octave:1> The line 21 in multipath.m is: 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]; I dont get where is the error ? someone can help me ? Thanks alot. -pol- ------------------------------------------------------------- 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 -------------------------------------------------------------