필터 지우기
필터 지우기

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 CenterFile Exchange에서 Surface and Mesh Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by