[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
trivial (probably) matlab->octave question
From: |
Rich Drewes |
Subject: |
trivial (probably) matlab->octave question |
Date: |
Mon, 22 Dec 2003 10:13:31 -0800 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030630 |
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
-------------------------------------------------------------
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- trivial (probably) matlab->octave question,
Rich Drewes <=