help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Parsing nightmare


From: Joe Koski
Subject: Re: Parsing nightmare
Date: Tue, 13 Jan 2004 17:39:39 -0700
User-agent: Microsoft-Entourage/10.1.1.2418

on 1/13/04 3:45 PM, Przemek Klosowski at address@hidden wrote:

>   [indmintmp,indmaxtmp] = extr( mps( k, max([(limpsl(k,i)-1),1]):finps(k,i), i
> ) );
> 
>  error: invalid number of indices (3) for matrix value
> 
> Unfortunately, this is a fundamental issue, which is only being
> resolved in the most recent versions of Octave. The statement above
> calls the extr() function on mps(k,x,i), where
> x=max([(limpsl(k,i)-1),1]):finps(k,i); that implies that mps is a 3D
> array, which is a relatively new Matlab and Octave facility.
> 
> I guess I am surprised that the problem didn't appear earlier, when mps was
> being
> set up---presumably there has to be code somewhere assigning values to
> mps(i,j,k).

You (and Octave) are correct in your diagnosis of a 3D matrix. When mps is
initially defined, the statement is simply

        mps = x;
 
where x is the input data row vector to be broken into segments. This fooled
me. However, later in the routine we see
        
        m(k,:) = mps(k,:,i);

which confirms the 3D usage.

> 
> There are two solutions to that: either use a late-version octave with
> multidimensional matrices, or recast the code to use matrix cells (q.v).
> 
How new does the Octave version have to be to include 3D matrices, 2.1.52?
(I'm using 2.1.46 from Fink.) Would the octave-forge spline routines be
compatible with the new version?

The recast approach may be the more feasible because the variable named mps
doesn't appear more than a half dozen times in the routine.

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
-------------------------------------------------------------



reply via email to

[Prev in Thread] Current Thread [Next in Thread]