From help-octave-request at bevo dot che dot wisc dot edu Mon Dec 22 12:18:55 2003 Subject: trivial (probably) matlab->octave question From: Rich Drewes To: help-octave at bevo dot che dot wisc dot edu Date: Mon, 22 Dec 2003 10:13:31 -0800 Hello, I am trying to get this simple Matlab function working under Octave: function dff = anglediff(d) dff=d; i=find(d>pi); dff(i)=2*pi-d(i); d is a two dimensional array. When run under Octave, I get this error: error: single index only valid for row or column vector The issue seems to be that find() returns indices as if the two dimensional array were concatenated into a vector, but the subsequent subtraction on the last line can't cope with this linearization of indices in Octave. Matlab somehow knows how to do the right thing with it though. (This raises the larger question: how many little semantic differences like this are there between Octave and Matlab?) Any suggestions on fixing this rather simple issue efficiently? Your help is greatly appreciated. I am a Matlab/Octave novice but long time open source enthusiast. I am trying to port this application to Octave because the licensing server for our Matlab install is having problems and there is nobody around to fix it. This makes me very annoyed. Thanks! Rich ------------------------------------------------------------- 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 -------------------------------------------------------------