Rank: 119 based on 1619 downloads (last 30 days) and 13 files submitted
photo

Wolfgang Schwanghart

E-mail
Company/University
University of Basel

Personal Profile:

Professional Interests:
GIS, Physical Geography, Hydrology

 

Watch this Author's files

 

Files Posted by Wolfgang View all
Updated   File Tags Downloads
(last 30 days)
Comments Rating
21 Sep 2009 Screenshot cropmat crop arrays with axis-aligned minimum bounding box Author: Wolfgang Schwanghart matrix, matrix manipulation, image processing 119 0
16 Sep 2009 Screenshot shuffle label randomly relabel a label matrix Author: Wolfgang Schwanghart matrix manipulation, image processing 114 0
15 Jun 2009 Screenshot Line Simplification Recursive Douglas-Peucker Polyline Simplification Author: Wolfgang Schwanghart interpolation, vertex reduction, polyline, approximations, mathematics, approximation 158 3
11 Feb 2009 Screenshot Strahler Stream Order returns the Strahler Stream Order based on channel and flow direction matrix Author: Wolfgang Schwanghart flow direction, earth sciences, upslope area, hydrology, geomorphology 103 0
07 Jan 2009 Screenshot Flow Accumulation (upslope area) Flow accumulation algorithm that routes through flats Author: Wolfgang Schwanghart geomorphology, earth sciences, hydrology, algorithms, elevation, model 129 7
  • 3.66667
3.7 | 3 ratings
Comments and Ratings by Wolfgang View all
Updated File Comments Rating
12 Aug 2009 IPDM: Inter-Point Distance Matrix An efficient and accurate Inter-Point Distance Matrix Author: John D'Errico

Thanks for this great contribution! Would it, however, be possible that ipdm (in case only data1 is provided) only returns the row and column indices and distances so that they are arranged in the order (distance(rowix,colix)): (2,1), (3,1), ..., (n,1), (3,2), ..., (n,2), ..., (n,n–1)). That is the way pdist (part of the statistics toolbox) returns the distance matrix in a vector to be more memory efficient. pdist, however, does not support distance subsets.

So far, I use this workaround in my code.

% remove distances were d.columnindex = d.rowindex
I = d.columnindex==d.rowindex;
d.columnindex(I) = [];
d.rowindex(I) = [];
d.distance(I) = [];

% remove double entry of pairs
[dtemp, m] = unique(sort([d.rowindex d.columnindex],2),'rows');
d.rowindex = dtemp(:,1);
d.columnindex = dtemp(:,2);
d.distance = d.distance(m);

This reduces the size of d by more than a half. But it doesn't avoid the generation of the huge struct returned by ipdm, which is a real memory bottleneck for me. Would it be possible to calculate this more efficient output within ipdm? So far I don't see a straightforward way, but perhaps you do?

Best regards,
Wolfgang

02 Aug 2009 Experimental (Semi-) Variogram calculate the experimental (semi-) variogram Author: Wolfgang Schwanghart

Hi Shazux,

the distance measure used here is the euclidean distance. I guess that is what you mean by direct distance, do you?

Best regards,
Wolfgang

10 Jul 2009 Graph adjacency matrix to incidence matrix Conversion from graph adjacency matrix to incidence matrix. Author: Ondrej

Now that's much better and much faster. Two minor things that can still be improved. First, if the adjacency matrix is supplied as full matrix, you don't really need to convert it to sparse. It should work without converting. Returning the incidence matrix as sparse however, is always a good idea since it likely contains many more zeros than the adjacency matrix.

Second, the function fails in case of nonzeros on the main diagonal. While this may rarely happen (except when your graph has 1-cycles), it may be worth an a-priori check using the function spdiags.

By the way, it might be nicer to write ~issparse(mAdj) instead of (issparse(mAdj)==0), but that's really not so important. And... providing a minimal example in the help block is always good.

Thanks for the update.

08 Jul 2009 Graph adjacency matrix to incidence matrix Conversion from graph adjacency matrix to incidence matrix. Author: Ondrej

At first sight, this function is quite good. It has a reasonable help, error checks and quite a few comments in the code. Yet, regarding its computational efficiency, there is a serious short-coming. It is heavily looped, both when extracting edges from the adjacency matrix and when building the incidence matrix. This makes the function slow and makes it even slower when you have a sparse adjacency matrix as input. You can easily vectorize this function using the find function with two outputs. Following lines have been written for a conversion from a (sparse) adjacency matrix B to a sparse incidence matrix A.

siz = size(B);
if siz(1)~=siz(2);
    error('B must be square');
end

nrknots = siz(1);
nredges = nnz(B);
[IXknots1,IXknots2] = find(B);
sones = ones(nredges,1);
IXedges = (1:nredges)';

A = sparse([IXedges; IXedges],...
             [IXknots1; IXknots2],...
             [-sones; sones],...
             nredges,nrknots);

Perhaps you have the time to modify your function so that it can handle sparse matrices efficiently. Right now, the function is very inefficient and hence I rate it with only one star. Yet, I am happy to change my rating when the above mentioned problems are fixed.

07 May 2009 mfiles/matfiles/figfiles Contains three functions for displaying different files with links. Author: Matt Fig

Matt, your screenshot gives credit to one of the most beloved contributors of the FEX :-) (Soccer_infinite_teams).
Nice tool though!

Comments and Ratings on Wolfgang's Files View all
Updated File Comment by Comments Rating
17 Aug 2009 Experimental (Semi-) Variogram calculate the experimental (semi-) variogram Author: Wolfgang Schwanghart Gharasoo, Shazux

sorry, I found out that these values are saved already in variable 'd' as a structure. thanks though

17 Aug 2009 Experimental (Semi-) Variogram calculate the experimental (semi-) variogram Author: Wolfgang Schwanghart Gharasoo, Shazux

that was what I meant, thank you :)
one more question, how to pass the data that has been plot? i mean here:
plot(out.distance,out.val,marker)
I need to do some curve fitting on those values...

02 Aug 2009 Experimental (Semi-) Variogram calculate the experimental (semi-) variogram Author: Wolfgang Schwanghart Schwanghart, Wolfgang

Hi Shazux,

the distance measure used here is the euclidean distance. I guess that is what you mean by direct distance, do you?

Best regards,
Wolfgang

30 Jul 2009 Experimental (Semi-) Variogram calculate the experimental (semi-) variogram Author: Wolfgang Schwanghart Gharasoo, Shazux

very nice program indeed. I had a question by the way. how the distance is calculated? direct distance or along X and Y streets?

10 Feb 2009 curvature 8-connected neighborhood curvature of a digital elevation model Author: Wolfgang Schwanghart Riccardo

fast on my grid-...

Top Tags Applied by Wolfgang
geomorphology, hydrology, mathematics, digital elevation model, earth sciences
Files Tagged by Wolfgang View all
Updated   File Tags Downloads
(last 30 days)
Comments Rating
17 Nov 2009 Screenshot 1-D to N-D robust smoothing SMOOTHN allows fast and robust smoothing in one and higher dimensions w/wo missing values Author: Damien Garcia statistics, smooth, image processing, signal processing 317 3
  • 4.66667
4.7 | 3 ratings
21 Sep 2009 Screenshot cropmat crop arrays with axis-aligned minimum bounding box Author: Wolfgang Schwanghart matrix, matrix manipulation, image processing 119 0
16 Sep 2009 Screenshot shuffle label randomly relabel a label matrix Author: Wolfgang Schwanghart matrix manipulation, image processing 114 0
15 Jun 2009 Screenshot Line Simplification Recursive Douglas-Peucker Polyline Simplification Author: Wolfgang Schwanghart interpolation, vertex reduction, polyline, approximations, mathematics, approximation 158 3
11 Feb 2009 Screenshot Strahler Stream Order returns the Strahler Stream Order based on channel and flow direction matrix Author: Wolfgang Schwanghart flow direction, earth sciences, upslope area, hydrology, geomorphology 103 0
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com