File Exchange

image thumbnail


version 1.0.0 (230 KB) by Herianto Lim
A peak-fitting tool based on MATLAB for spectroscopic data analysis.


Updated 07 Nov 2018

GitHub view license on GitHub

Fit spectral data with a linear combination of symmetric peak functions such as Gaussian or Lorentzian.

Cite As

Herianto Lim (2020). PeakFit (, GitHub. Retrieved .

Comments and Ratings (6)

I may have understand how to use addpackage, however I encountered a new error while running VO2_RAMAN

"Error using PeakFit/fit
Method 'fit' is not defined for class 'PeakFit' or is removed from MATLAB's search path.

Error in PeakFit (line 334)

Error in VO2_Raman (line 18)

I never had to install package before. I downloaded the Common and Graphics packages but I cannot figure out where to put them so Matlab can find them. I also tried using MatVerCon package but it still does not work.

The error message i get is :
"Undefined function or variable 'isrealmatrix'.

Error in PeakFit (line 302)
if k<=N && isrealmatrix(varargin{k})

Error in VO2_Raman (line 18)
Thank you


Herianto Lim

Hi Rolf, sorry for the late reply. Have you included my other package MatGraphics ( in your system? Cheers.


when running VO2_Raman I am getting the following error message
Error in VO2_Raman (line 27)

After commenting Groot out, it stops at
Error using Label.peak (line 269)
Input to the plot lines must be either a two-row or two-column real matrix or an array of graphics handles to Line objects.

Error in VO2_Raman (line 63)

Any suggestions?
Regards Rolf

Herianto Lim

This package require some files in my other repositories. Please refer to the README on the GitHub page where this package is hosted. Cheers.


Dear Herianto Lim,

Thanks for your code, which is a great work.

I had some problems while running your examples. The file of PeakFit.m was used by your examples, then the matlab 2017a was giving Undefined functions or variables(including isrealmatrix, isrealvector and isstringscalar).

Could you give me some guidance, please.

Thanks a lot.

MATLAB Release Compatibility
Created with R2013b
Compatible with R2013b to R2018a
Platform Compatibility
Windows macOS Linux