File Exchange

image thumbnail


version (7.42 KB) by Harald Hentschke
abfload imports data in the Axon abf format (three different recording modes).


Updated 17 Jun 2011

View Version History

View License

abfload imports data in the Axon abf format. Data may have been acquired in the following modes:

(1) event-driven variable-length
(2) event-driven fixed-length
(3) gap-free

The major output variable d may be a 2D array, a 3D array or a cell array, depending on the recording mode. Information about scaling, the time base (that is, the sampling frequency), and the number of channels and episodes is extracted from the header of the abf file. For details, see help text of abfload.
** PLEASE NOTE: abfload can only deal with abf versions <2 (files acquired with pclamp versions <10). Use abf2load (see below) for all abf versions including the new ones.

Cite As

Harald Hentschke (2021). abfload (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (20)

Harald Hentschke

Yep: see the links in my comment from July 20, 2019.


Could you please tell is there any scripts available to extract abf files of versions >2, i.e. acquired with pclamp versions >10?

Madan Ghimire

Hi, I can't find abf2load in this page. Did you move it somewhere else?
I can,t load my files with abfload.

anass EL HAJLI

best16 programmer

hello,thank you for this it was very useful. I have a problem with the time plotting,when i plot extracted data the time in x axis does not look like the one in the clampfit file,can you help me ?

Eran Zohar


hello, thank you very useful. I want replace the old file we use by the newest version, but option 'info' look like remove. You talk about abfinfo.m in the header but I cannot found this file. Can you help me?

Laurens Witter

Very useful utility, I use it a lot.
There seems to be a problem sometimes with clampfit generated files. The solution is to include the following after 'the hack' (~line 275):
if isempty(goodstart)
goodstart = strfind(lower(char(BigString)'),'clampfit');

Also, in the functions 'define_xxxxxxx' the use of % in names is problematic because this leads to truncated statements in the function ReadSection. Easiest solution is to take all '%' out.

With these small changes I can load all files I want.


Praneeth Namburi

Great utility! thank you :)



I partially ported this code to python, see


Great function.
It would be really useful to use 'single' (or even 'int16') variable type for loading in data. This should be more then sufficient for the 12bit encoding in abf files and would save a substantial amount of space. doubles are 64bit and I routinely run out of memory in matlab when using abfload larger files.
Suggestions are welcome.

Yoav Mor

I have found that it is not the nDataFormat that needs to be changed to "Short", rather it is the "nADCNumChannels". Changing this to Short fixes a range of problems with reading abf files, up to version 1.83 (that's what I tested).

Carlos E

On a related note, the latest versions of pCLAMP/Axoscope 10.x can export ABF2 files as ABF 1.8 files

Carlos E

The ABF variable nDataFormat is of type 'short' for version 1.8 of the ABF header. abfload uses an int and so it reads more than it should when trying to open ABF 1.8 files. Usually it just fails. Therefore if you want to open and ABF 1.8 file just change the line 'nDataFormat',100,'int',-1; to use short instead of int then it should work.

Harald Hentschke

Please note: abfload will not work with data acquired with versions 10.x (and up) of pClamp/Axoscope because of major changes in the header structure. There is no way these changes can be accomodated as details of the header structure (which are essential for direct header access into abf files) will no longer be made publicly available.

Joanna Huttunen

Excellent for older types of .abf files. For files collected with Axoscope 10, it does not work... =(

Jim Chambers

works great...I am using it to generate IV curves in real time. Very nice.

MATLAB Release Compatibility
Created with R13SP1
Compatible with any release
Platform Compatibility
Windows macOS Linux

Inspired: fcollman/abfload, cengique/pandora-matlab

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!