## BIN2MAT

バージョン 1.2.0.0 (2.28 KB) 作成者:
Create a matrix from scattered data without interpolation

ダウンロード: 1.7K

ライセンスの表示

BIN2MAT can be used to create a grid from scattered 2D data using grid-cell averaging (no interpolation). BIN2MAT also accepts function handles so you can evaluate many different functions over each grid cell. If the specified function returns non-scalar output, BIN2MAT will return a cell array.

EXAMPLE (generates screen-shot)

%generate some scattered data
[x,y,z]=peaks(150);
ind=(rand(size(x))>0.9);
xs=x(ind); ys=y(ind); zs=z(ind);

%create a grid
xi=min(xs):0.25:max(xs);
yi=min(ys):0.25:max(ys);
[XI,YI]=meshgrid(xi,yi);

%calculate the mean and standard deviation
%for each grid-cell using bin2mat
Zm=bin2mat(xs,ys,zs,XI,YI); %mean
Zs=bin2mat(xs,ys,zs,XI,YI,@std); %std

%plot the results
figure
subplot(1,3,1);
scatter(xs,ys,10,zs,'filled')
axis image
title('Scatter Data')

subplot(1,3,2);
pcolor(XI,YI,Zm)
axis image
title('Grid-cell Average')

subplot(1,3,3);
pcolor(XI,YI,Zs)
axis image
title('Grid-cell Std. Dev.')

### 引用

Andrew Stevens (2023). BIN2MAT (https://www.mathworks.com/matlabcentral/fileexchange/23479-bin2mat), MATLAB Central File Exchange. 取得済み .

すべてのリリースと互換性あり
##### プラットフォームの互換性
Windows macOS Linux
##### 謝辞

ヒントを与えたファイル: CURVVEC

### Community Treasure Hunt

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

Start Hunting!
バージョン 公開済み リリース ノート
1.2.0.0

modified error-checking, also add a check to make sure x,y,z inputs are column (m x 1) vectors.

1.0.0.0