[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: setdiff: Octave <-> Matlab
From: |
Paul Kienzle |
Subject: |
Re: setdiff: Octave <-> Matlab |
Date: |
Tue, 14 Jun 2005 23:02:48 -0400 |
Octave-forge has setdiff. If you do some replacements:
unique(x) -> unique(x,'rows')
sort(x) -> sortrows(x)
a(x)==b(y) -> all(a(x,:) == b(y,:),2)
c(x) = [] -> c(x,:) = []
it should do what you need.
Please send a patch once you get it working, and once you have some
test cases demonstrating it. Some of the other set functions (e.g.,
intersect) also need extending to handle rows.
Thanks,
- Paul
On Jun 14, 2005, at 2:10 PM, address@hidden wrote:
I am tying to use the setdiff command in octave. I am trying to get a
script that works in Matlab to work in octave. In matlab the syntax
is:
c = setdiff(A, B, 'rows'), when A and B are matrices with the same
number of columns, returns the rows from A that are not in B.
in octave the syntax is similar, but it does not take the rows option.
Not knowing exactly how Matlab works(I do not have a working copy) I
do not know how to get they same output in octave. Can someone help
who has a copy of Matlab??
Thanks!!
Lou
-------------------------------------------------------------
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
-------------------------------------------------------------
-------------------------------------------------------------
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
-------------------------------------------------------------