Rank: 140 based on 455 downloads (last 30 days) and 10 files submitted
photo

Jonas Lundgren

E-mail
Lat/Long
58.53076171875, 15.03366374969482

Personal Profile:
Professional Interests:
Mathematics

 

Watch this Author's files

 

Files Posted by Jonas View all
Updated   File Tags Downloads
(last 30 days)
Comments Rating
08 Mar 2012 Screenshot Alpha shapes Alpha shape of 2D/3D point set. Author: Jonas Lundgren alpha shape, alpha shapes, volume, area, geometry, alpha hull 84 19
  • 5.0
5.0 | 15 ratings
23 Feb 2012 Screenshot TSPSEARCH Heuristic method for the Traveling Salesman Problem (TSP) Author: Jonas Lundgren tsp, traveling salesman pr..., optimization 26 7
  • 4.5
4.5 | 4 ratings
02 Dec 2011 Screenshot ZEROBESS Zeros of Bessel functions of 1st and 2nd kind plus zeros of the derivatives. Author: Jonas Lundgren mathematics, zeros, bessel function, zerobess, bessel, derivatives 43 3
  • 5.0
5.0 | 5 ratings
22 Nov 2011 Screenshot SPLINEFIT Fit a spline to noisy data. Author: Jonas Lundgren approximation, interpolation, cubic spline, ppval, spline, noisy data 200 44
  • 4.62069
4.6 | 29 ratings
21 Nov 2011 ICHOOSE Choose K indices from the set 1:N. Author: Jonas Lundgren choose, combinations, mathematics, nchoosek 12 2
  • 5.0
5.0 | 1 rating
Comments and Ratings by Jonas View all
Updated File Comments Rating
21 May 2014 Pair-wise Euclidean Distance Matrix Computing the distance matrix without loops Author: Quan Wang

Dear Quan Wang,

It is a widespread misunderstanding that MATLAB loops are slow in general. Loops with simple math operations can be very fast. Waste of memory is always slow and so is the function repmat.

Compare distanceMatrix(X) with distmat(X) below. X = rand(1000,3).

I am sure you will reply with something even faster. I look forward to update the rating.

Kind regards
Jonas Lundgren

%------------------
function D = distmat(X)
%DISTMAT Compute euclidian distance matrix from coordinates

[n,dim] = size(X);
D = zeros(n);
for j = 1:n
for k = 1:dim
v = X(:,k) - X(j,k);
D(:,j) = D(:,j) + v.*v;
end
end
D = sqrt(D);

27 Apr 2012 Alpha shapes Alpha shape of 2D/3D point set. Author: Jonas Lundgren

Jorge Leandro, tilde represents an unused argument. This notation was introduced in MATLAB 2009b. You can safely replace tilde by a dummy variable.

25 Apr 2012 SPLINEFIT Fit a spline to noisy data. Author: Jonas Lundgren

Maas, I admit that the splinebase function is a bit cryptic (also for the author). Unfortunatelly I can't see any quick fix to achieve the spline base you ask for.

28 Mar 2012 SPLINEFIT Fit a spline to noisy data. Author: Jonas Lundgren

Michael, splinefit fits a picewise polynomial curve to your data set by least squares. In the cubic case the curve has continuous second derivative. In other cases the regularity will follow the order of the spline. This is achieved by a base of spline curves with minimal support (B-splines). The method is straightforward and I have no specific reference. You can study B-splines and the method of least squares in the textbooks.

The smoothing effect on the noisy data is controlled by the degrees of freedom of the curve, i.e. the number of pieces. A cubic spline with P pieces has P+3 degrees of freedom. If the number of data points is greater than P+3 smoothing will happen.

Splinefit has no support for a desired tolerance or standard deviation. You have to select the number of pieces, see what you get and try again OR write a clever code for the task.

You can find the theory behind csaps/spaps in the documentation.

27 Feb 2012 Alpha shapes Alpha shape of 2D/3D point set. Author: Jonas Lundgren

Borc, Yes I am aware of these artefacts in the 3D case. Thats why the code only delivers volume and not boundary faces. I will give this some thought.

Comments and Ratings on Jonas' Files View all
Updated File Comment by Comments Rating
28 Aug 2014 SPLINEFIT Fit a spline to noisy data. Author: Jonas Lundgren samfort

16 Aug 2014 Alpha shapes Alpha shape of 2D/3D point set. Author: Jonas Lundgren turksoy, kamuran

Once you define the alpha shape based on n number or points 2D, how would you check if a new point is inside the shape or not? Thanks

07 Aug 2014 SPLINEFIT Fit a spline to noisy data. Author: Jonas Lundgren Dennis A. Dean, II, Ph.D.

Exactly what I needed to generate prototypical data examples for presentation from noisy data.

05 Aug 2014 SPLINEFIT Fit a spline to noisy data. Author: Jonas Lundgren ahmed, zaki

how can i convert polynomial fitting into cubic splines

16 Jun 2014 Alpha shapes Alpha shape of 2D/3D point set. Author: Jonas Lundgren Violeta

Thank you very much for this useful code. I have a question, it would be great if you could help. Consider 3D data sampled from the same type of physical object whose shape/size varies from one sample to another, which means the radius as a parameter of triangulation varies across samples as well. What would then be the best criterion for the choice of radius? Any idea(s) would be very helpful. Many thanks in advance.

Contact us