フィルターのクリア

To select indices in areal density plot

1 回表示 (過去 30 日間)
Bhowmik.U
Bhowmik.U 2017 年 1 月 20 日
I have X and Y column matrices, I need to plot occurrence density of X-Y pair in 5*5 bin in an area of 250*250, so a total 50 boxes in X and 50 in Y...2500 boxes in 2D, I did it through a code I paste here my code.
But, I wish to know indices of each X-Y pair in all the boxes separately?
My code runs
[X, txt1, raw1] = xlsread('A.xls',1,'M:M');
[Y, txt1, raw1] = xlsread('A.xls',1,'N:N');
binmin = -125; binmax = 125; binwidth = 5;
xbin = 1 + floor((X(:) - binmin) / binwidth); ybin = 1 + floor((Y(:) - binmin) / binwidth); nbins = ceil((binmax - binmin) / binwidth); counts = accumarray([xbin, ybin], 1, [nbins, nbins]); counts=(counts./max(max(counts))); figure(1)
imageSizeX = 50; imageSizeY = 50; figure(1) [columnsInImage rowsInImage] = meshgrid(1:imageSizeX, 1:imageSizeY); % Next create the circle in the image. centerX = 25; centerY = 25; radius = 25; % centerX =50; % centerY = 50; % radius = 50; circlePixels = (rowsInImage - centerY).^2 ... + (columnsInImage - centerX).^2 <= radius.^2; final = double(circlePixels) contourf(final);

回答 (0 件)

カテゴリ

Help Center および File ExchangeSurface and Mesh Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by