1

I am trying to plot the ranges of different cellular base stations in MATLAB, like this:

sample plot

But I can't figure out how to do it.

0

3 Answers 3

5

Here's an example of how you can create a plot like this. Note that I created sample data for the plot by randomly generating the positions of cellular base stations using uniformly distributed pseudorandom numbers:

%# Initializations: minRange = 0; %# Lower x and y range maxRange = 3.5; %# Upper x and y range resolution = 1000; %# The number of data points on the x and y axes cellRange = linspace(minRange, maxRange, resolution); [x, y] = meshgrid(cellRange); %# Create grids of x and y coordinates cellCoverage = zeros(size(x)); %# Initialize the image matrix to zero %# Create the sample image data: numBases = 200; cellRadius = 0.75; for iBase = 1:numBases point = rand(1,2).*(maxRange - minRange) + minRange; index = ((x - point(1)).^2 + (y - point(2)).^2) <= cellRadius^2; cellCoverage(index) = cellCoverage(index) + 1; end %# Create the plot: imagesc(cellRange, cellRange, cellCoverage); %# Scaled plot of image data axis equal; %# Make tick marks on each axis equal set(gca, 'XLim', [minRange maxRange], ... %# Set the x axis limit 'YLim', [minRange maxRange], ... %# Set the y axis limit 'YDir', 'normal'); %# Flip the y axis direction xlabel('X-distance (km)'); %# Add an x axis label ylabel('Y-distance (km)'); %# Add a y axis label colormap(jet); %# Set the colormap colorbar; %# Display the color bar 

And here's the resulting plot:

enter image description here

Note also that the data in the image matrix cellCoverage contains no noise and has no smoothing applied, which is why the edges appear sharper than the original image in the post (which I'm guessing is generated from real data, not "fake" sample data like I used here).

Sign up to request clarification or add additional context in comments.

Comments

0

Use "image"

image(x),colormap(hsv) <- where x is a matrix of cellular intensities(x,y)

3 Comments

To clarify, I believe x must be a 2D matrix of values between 0 and 1. But doc image, doc colormap know more about that than I do.
then rescale values to 0 to 255 and do hsv(255)
The figure in question done with imagesc function (auto scaling) and jet colormap.
0

You need to get the coordinate of each station then create a circle polygon around it (with a given radius), then convert this polygon into a grid. Then you sum up these grids (matrices) on top of each other. For speed, instead of using polygons you can also define which cells will be covered by a station, like all cells within 5 rows or columns of a station get the value. You can also apply a 2D Gaussian filter to your matrix, where only the cells containing a station have a value of 1. The bandwidth of your Gaussian kernel will be your coverage radius (range). http://www.mathworks.ch/help/toolbox/images/ref/fspecial.html

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.