View License

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Highlights from

3.9 | 15 ratings Rate this file 18 Downloads (last 30 days) File Size: 876 KB File ID: #2411 Version: 1.2
image thumbnail



Nobuhito Mori (view profile)


20 Sep 2002 (Updated )

PIV method in MATLAB

| Watch this File

File Information

'mpiv ', PIV toolbox in MATLAB, is a program made for the beginner of PIV (Particle Image Velocimetry) method. The main reason why I made this program was educational purpose for undergraduate and graduate student. The code is simple and may easy understand.

Since fall 2002, several algorithms has been added and mpiv has sufficient accuracy and options at present.

Required Products Image Acquisition Toolbox
MATLAB release MATLAB 6.5 (R13)
Other requirements DACE (A Matlab Kriging Toolbox) is required for advanced interpolations. Please down load it from
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (23)
04 Aug 2016 Fres Wong

06 Apr 2016 Yasser Elhouderi

DACE can be downloaded using this link

Comment only
01 Jul 2015 Azalin L

it's very useful for me :)

27 Aug 2014 Nobuhito Mori

Nobuhito Mori (view profile)

You need enough number of particles or some characteristic patterns to estimate vectors in your input images. If there is no patterns, mpiv cannot estimate movement of patters.

Comment only
26 Aug 2014 Heather Cirka

I really like this code, but do have a question for other users.
Recently I began running an image against itself, expecting to get zero or the program to fail.
I end up detecting vectors (although small ones). Does any have any understanding of why this might be the case?
Thanks in advance

26 Oct 2012 Nobuhito Mori

Nobuhito Mori (view profile)

I think there are several required level of image.
1. enough particle density in the image
2. uniformly distributed particle in the image

If your image is not satisfy above two conditions, 'mpd' is more robust to obtain vectors.
here is sample script to obtain attached results.
[xi,yi,iu,iv] = mpiv(f1,f2, 64,64, 0.5,0.5, 20,20, 1, 'mqd', 2, 1);
[iu_f,iv_f,iu_i, iv_i] = mpiv_filter(iu,iv, 2, 2.0, 3, 1);

Comment only
25 Oct 2012 Ian

Ian (view profile)

Help! I can run the examples bmp with no issues, but with my own ones i get this error.

??? Error using ==> chckxy at 106
There should be at least two data points.

As i have more 'speckle' images i used 'mqd' and the above error presumably came from an abundance of

Warning: Divide by zero.

during processing...and advice?


Comment only
18 Oct 2012 Vishal

Vishal (view profile)


It would be simply great if anyone could help me understant the reason for this error: Reference to non-existent field 'pushbutton_filename1'.

Error in mpiv_gui>pushbutton_filename1_Callback (line 225)

Error in gui_mainfcn (line 96)

Error in mpiv_gui (line 42)
gui_mainfcn(gui_State, varargin{:});

Error while evaluating uicontrol Callback.

Thanks & Regards,

Comment only
17 Sep 2010 chongyuan

could you plz mail me the documentation of this to my email(,it's a great help for me to understand the code.i need this for my project Looking forward for your help.

Comment only
27 Feb 2010 Azalin L

26 Nov 2009 Thomas Clark

DACE kriging toolbox can be found here:

Comment only
09 Jul 2009 MacGuiness MacGee

If anyone else is having the same problem, you need to download the DACE kriging toolbox. Excellent program - many thanks.

09 Jul 2009 MacGuiness MacGee

I have had the same problem as Glen Lichtwark - I receive the following error message: Undefined function or variable 'dacefit.' I'd appreciate it if someone could help with this.

12 Jun 2009 Thomas Clark

Not advanced, but that's not the point - for someone learning PIV this is straightforward, flexible and extremely well documented.

Top marks, and thankyou for the time and effort which has clearly gone into this submission


01 Mar 2007 Azalin L

it's very useful for me ;I

05 Jan 2007 Harold Odom

27 Jul 2005 Nico Krause

the subpixel find function is incorrect. the x and y direction are interchanged.

18 May 2005 Glen Lichtwark

I had a problem getting th example data to work. The error was -->
??? Undefined function or variable 'dacefit'.

Error in ==> C:\MATLAB\work\mpiv_toolbox\vector_interp_kriging.m
On line 87 ==> [dmodel,perf] = dacefit( S, Y, @regpoly2, @corrgauss, theta );

Comment only
21 Apr 2004 Anthony H

Excellent but it will be more helpful if the accompanying user manual can cover abit more information, especially for each function called during the tracking process.

Thanks Mr. Mori.

16 Feb 2004 James Young

A good implementation of PIV in Matlab with excellent accompanying documentation.

10 Apr 2003 . .

15 Jan 2003 C.S kim

it's very useful for me

25 Sep 2002 Kent

This is good to understand PIV on MATLAB

11 Dec 2002

The main routine has been modified and add new algorism.

27 Mar 2003

Check MQD value routine has been added.

07 Apr 2003

Check MQD value routine has been added.

07 Jul 2003

All codes are totally refined.
The latest version is 0.95.

01 Jul 2009 1.1

BSD license has been applied.

13 Jul 2009 1.2

BSD license has been applied (revised).

Contact us