|
From: | Mike Miller |
Subject: | Re: setdiff: Octave <-> Matlab |
Date: | Tue, 14 Jun 2005 14:04:01 -0500 (CDT) |
On Tue, 14 Jun 2005, John W. Eaton wrote:
On 14-Jun-2005, 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??Why should that be necessary? If you want to implement something for Octave, then you must not refer to Matlab M-files. You know what the function is supposed to do, so the task is to make an independent implementation.
I think he does not know what the function is supposed to do because he doesn't understand the 'rows' argument.
Sometimes a simple google search can help because MATLAB docs are on the web:
http://taxa.epi.umn.edu/bgnews/2003/msg00074.htmlc = setdiff(A, B) returns the values in A that are not in B. The resulting vector is sorted in ascending order. In set theory terms, c = A - B. A and B can be cell arrays of strings.
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.
Mike ------------------------------------------------------------- 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] |