Rank: 4861 based on 2 downloads (last 30 days) and 4 files submitted
photo

Garrett Euler

E-mail

Personal Profile:
Professional Interests:
signal processing in seismology

 

Watch this Author's files

 

Files Posted by Garrett View all
Updated   File Tags Downloads
(last 30 days)
Comments Rating
04 Apr 2008 matchsort Replicate a sort operation using the returned permutation indices Author: Garrett Euler matrices, sort, replicate, matchsort, matrix manipulation 2 3
03 Apr 2008 sort2li Transforms permutation indices from sort to linear indices Author: Garrett Euler matrices, sort indices, transforms, permutation, incides, matrix manipulation 0 0
03 Apr 2008 submat_noeval Returns the input matrix reduced along indicated dimensions (without eval) Author: Garrett Euler matrices, submatrix subset suba... 0 3
26 Mar 2008 submat Returns the input matrix reduced along indicated dimensions Author: Garrett Euler matrices, submatrix subset suba... 0 2
Comments and Ratings on Garrett's Files View all
Updated File Comment by Comments Rating
03 Apr 2008 submat_noeval Returns the input matrix reduced along indicated dimensions (without eval) Author: Garrett Euler Euler, Garrett

Yea I did not know that one. Matlab takes the string ':' as a special case when indexing matrices...anything else like '1:2' etc though doesn't work without an eval. Thanks, I'll update!

03 Apr 2008 submat_noeval Returns the input matrix reduced along indicated dimensions (without eval) Author: Garrett Euler x@y.z, Jos

I have some problems understanding this code:
Apparently, -- Y = submat_noeval(X,D,F) -- is the same as -- ind(1:ndims(X)) = {':'} ; ind{D} = F ; Y = X(ind{:}) --

which would allow for a much simpler code:
Y = fun(X,varargin)
ind(1:ndims(X)) = {':'} ;
i = 1:2:nargin-1 ;
ind{[varargin{i}]} = deal(varargin{i+1}) ;
Y = X(ind{:}) ;

Please correct me if I am wrong ...

03 Apr 2008 matchsort Replicate a sort operation using the returned permutation indices Author: Garrett Euler D'Errico, John

I''ll concede that as a valid use.

02 Apr 2008 matchsort Replicate a sort operation using the returned permutation indices Author: Garrett Euler Euler, Garrett

Sure its trivial if x is a vector...not as much if x is a n-d matrix sorted down an arbitrary dimension. Note that your example won't work for anything other than a vector. This function is useful for parallel sorting of matrices of 2+ dimensions.

A clearer example:
a=magic(10);
b=1./a
c=-a
[d,i]=sort(a,2)
e=matchsort(b,i,2)
f=matchsort(c,i,2)
isequal(d,1./e,-f)

02 Apr 2008 matchsort Replicate a sort operation using the returned permutation indices Author: Garrett Euler D'Errico, John

I'm confused. Exactly what does this function do that the trivial code below does not do?

[x,tags] = sort(x);
y = y(tags);

Top Tags Applied by Garrett
matrices, matrix manipulation, submatrix subset subarray, incides, matchsort
Files Tagged by Garrett View all
Updated   File Tags Downloads
(last 30 days)
Comments Rating
04 Apr 2008 matchsort Replicate a sort operation using the returned permutation indices Author: Garrett Euler matrices, sort, replicate, matchsort, matrix manipulation 2 3
03 Apr 2008 sort2li Transforms permutation indices from sort to linear indices Author: Garrett Euler matrices, sort indices, transforms, permutation, incides, matrix manipulation 0 0
03 Apr 2008 submat_noeval Returns the input matrix reduced along indicated dimensions (without eval) Author: Garrett Euler matrices, submatrix subset suba... 0 3
26 Mar 2008 submat Returns the input matrix reduced along indicated dimensions Author: Garrett Euler matrices, submatrix subset suba... 0 2

Contact us at files@mathworks.com