Code covered by the BSD License
Highlights from
mpiv
-
gui_confirm_mpivstart(varargi...
MODALDLG Application M-file for untitled.fig
-
modaldlg(varargin)
MODALDLG Application M-file for untitled.fig
-
mpiv_gui(varargin)
MPIV_GUI M-file for mpiv_gui.fig
-
[ xi, yi, nx_start, ny_start,...
-
[iu_ft,iv_ft,iu_ip,iv_ip]=mpi...
-
[xi,yi,iu,iv,D]=mpiv( imr1, i...
-
func_countNaN( fi );
-
func_findpeak2( f, i_opt );
-
func_histfilter( u )
To calculate mean and standard deviation by filtering out the
-
func_smooth(z)
-
mpiv_smooth( iu, iv, i_plot)
-
mpiv_vor( u, v, i_plot)
% This program is to calculate and plot vorticity using PIV.
-
nanmean2(x)
% nanmean 2 average ignoring NaNs for 2D variable
-
piv_cor( im1, im2, ...
-
piv_crr( im1, im2, ...
-
piv_crs( im1, im2, ...
-
piv_mqd( im1, im2, ...
-
piv_mqd( im1, im2, ...
-
piv_mrs( im1, im2, ...
-
piv_windowsize( nx,ny, nx_pix...
-
vector_check( iu, iv, vec_std...
-
vector_filter_global( ui, vi,...
-
vector_filter_median( ui, vec...
-
vector_filter_vecstd( ui, vec...
-
vector_interp( ui, i_interp )
-
vector_interp_NaN( ui )
-
vector_interp_kriging( ui )
-
vector_interp_kriging( ui )
-
vector_interp_linear( ui )
-
vector_interp_linear( ui )
-
vector_interp_spline( ui )
-
test_findpeak2.m
-
View all files
from
mpiv
by Nobuhito Mori
PIV method in MATLAB
|
| nanmean2(x) |
function y = nanmean2(x)
%
% nanmean 2 average ignoring NaNs for 2D variable
%
%======================================================================
%
% Terms:
%
% Distributed under the terms of the terms of the BSD License
%
% Copyright:
%
% Nobuhito Mori
% Disaster Prevention Research Institue
% Kyoto University, JAPAN
% mori@oceanwave.jp
%
%======================================================================
if isempty(x) % Check for empty input.
y = NaN;
return
end
% Replace NaNs with zeros.
nans = isnan(x);
i = find(nans);
x(i) = zeros(size(i));
% count terms in sum over first non-singleton dimension
dim = find(size(x)>1);
if isempty(dim)
dim = 1;
else
dim = dim(1);
end
count = sum(sum(~nans,dim));
% Protect against a column of all NaNs
i = find(count==0);
count(i) = 1;
y = sum(sum(x,dim))./count;
y(i) = NaN;
|
|
Contact us at files@mathworks.com