From help-octave-request at bevo dot che dot wisc dot edu Tue Jan 13 14:28:46 2004 Subject: Parsing nightmare From: Joe Koski To: Octave_post Date: Tue, 13 Jan 2004 13:25:39 -0700 In converting a MATLAB script, the following statement is confusing to both me and Octave. The statement is [indmintmp,indmaxtmp] = extr(mps(k,max([(limpsl(k,i)-1),1]):finps(k,i),i)); Where extr is a routine that returns the extrema in a row vector (mps in this case) of data for spline fitting. The error that Octave, even in --braindead mode, gives is error: invalid number of indices (3) for matrix value At first I thought the max function was the problem, but placing that into a separate statement ahead of this statement pointed to problems with the finps(k,i),i portion of the statement. Both k and i are indices apparently set to 1 at the time of the error. The variable finps was defined previously by % end of available data for block sifting finps(1,1:NBPRESIFT) = 1; finps(1,1) = 10*PAS; Where PAS is set to 20. I suspect I need some extra parentheses or other delimiters to resolve this, but my arbitrary tries at inserting extra parentheses didn't fix the problem. What is finps(k,i),i trying to do? Select a column? How would MATLAB parse this? How do I rewrite the statement? Any ideas will be appreciated. Joe Koski ------------------------------------------------------------- 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 -------------------------------------------------------------