Rank: 174 based on 495 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 120 20
  • 5.0
5.0 | 18 ratings
23 Feb 2012 Screenshot TSPSEARCH Heuristic method for the Traveling Salesman Problem (TSP) Author: Jonas Lundgren tsp, traveling salesman pr..., optimization 30 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 34 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 208 47
  • 4.65625
4.7 | 32 ratings
21 Nov 2011 ICHOOSE Choose K indices from the set 1:N. Author: Jonas Lundgren choose, combinations, mathematics, nchoosek 7 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
16 Oct 2014 SPLINEFIT Fit a spline to noisy data. Author: Jonas Lundgren Greg

Excellent. Huge time save. Thank you.

13 Oct 2014 Alpha shapes Alpha shape of 2D/3D point set. Author: Jonas Lundgren John

Excellent. It is very easy to use and provides much better detail than using plot3 on a data-set.

03 Oct 2014 Alpha shapes Alpha shape of 2D/3D point set. Author: Jonas Lundgren David

01 Oct 2014 Alpha shapes Alpha shape of 2D/3D point set. Author: Jonas Lundgren Aykin, Murat

23 Sep 2014 SPLINEFIT Fit a spline to noisy data. Author: Jonas Lundgren Liwei

I have one question. The curve fitting use b spline. In the code, mkpp is used. Why not use spmak? the function will represent splines in b-form.

Contact us