Skip to content

ebauch/matlab

Repository files navigation

matlab code examples

Erik Bauch, May 2017

fitnlorentzian.m - Fit n number of Lorentzian peaks / sum of Lorentzian to data

  1. Download fitnlorentzian.m plus example data in 4peaksdata.dat (or clone repo)
  2. in matlab run
    % import xy data
    data = load('4peaksdata.dat');
    
    % fit data with n = 1,...,4 peaks
    n = 4;
    fitnlorentzian(data, n)

Lorentzian fitting example

this code on mathworks fileexchange

fitngaussian.m - Fit n number of Gaussian peaks / sum of Gaussian to data

  1. Download fitngaussian.m plus example data in 4peaksdata.dat (or clone repo)
  2. in matlab run
    % import xy data
    data = load('4peaksdata.dat');
    
    % fit data with n = 1,...,4 peaks
    n = 4;
    fitngaussian(data, n)

Gaussian fitting example

this code on mathworks fileexchange

About

code examples for Matlab

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages