How to plot 2D location vs corresponding data in MATLAB

조회 수: 6 (최근 30일)
Shwet Kashyap
Shwet Kashyap 2022년 5월 14일
댓글: Walter Roberson 2022년 5월 31일
Hi,
I have location of users in terms of lattitude and longitude, each user have a particular demand value. I have to create clusters using the position of users, and demand. Can anyone help me in designing it as there are three variables.
One another part of the problem is to how to plot it in such a way that lattitude comes in x axis, longitude in y axis, and user demand corresponding to them
It is like this
User Lattitude Longitude Demand
1 38.8643 9.2866 13
and so on
Please help me out.
  댓글 수: 9
Shwet Kashyap
Shwet Kashyap 2022년 5월 18일
Hey Dyuman,
Did you get the data, any progress or any suggestion, please if possible
Walter Roberson
Walter Roberson 2022년 5월 18일
(Context appears to be fixed-beam signals for geostationary communication satellites.)

댓글을 달려면 로그인하십시오.

답변 (3개)

KSSV
KSSV 2022년 5월 18일
편집: KSSV 2022년 5월 18일
REad abour kmeans
T = readtable('https://in.mathworks.com/matlabcentral/answers/uploaded_files/999455/MATLAB.xlsx')
T = 6689×3 table
Lattitude Longitude Demand _________ _________ ______ 38.864 -9.2866 13 39.073 -9.1616 13 38.606 -9.0866 13 38.614 -8.9283 13 39.089 -8.8949 13 38.848 -8.8116 13 37.706 -8.7699 13 37.622 -8.7116 13 38.614 -8.6949 13 39.006 -8.6449 13 37.347 -8.6282 13 38.731 -8.5782 13 38.864 -8.5449 13 39.048 -8.5282 13 38.214 -8.4866 13 38.439 -8.4282 13
x = T.(1) ;
y = T.(2) ;
d = T.(3) ;
idx = kmeans([x y d],71) ;
Warning: Ignoring rows of X with missing data.
scatter3(x,y,d,[],idx,'filled')
colorbar
cmap = turbo(71) ;
colormap(cmap)
view(2)
  댓글 수: 5
Shwet Kashyap
Shwet Kashyap 2022년 5월 20일
hey I tried the dot command, and was able to plot as dots, but still not sure how to count the nymber of dots, or corresponding value, please help.
Attachin the plot.
Shwet Kashyap
Shwet Kashyap 2022년 5월 22일
idx = T.Demand == 13 ;
T(idx,:)
This command provide data from the original table T, I require data from the clustered table.

댓글을 달려면 로그인하십시오.


Walter Roberson
Walter Roberson 2022년 5월 18일
You can create a triangulation object and then use trimesh() to plot the data.
Or you can create a scatteredInterpolant() object and interpolate over a grid of coordinates and then imagesc() or pcolor() to create a map.
  댓글 수: 7
Shwet Kashyap
Shwet Kashyap 2022년 5월 24일
Hey,
Thanks for your attempt, may be I was not able to explain you the problem.
Here I don't want to divide the demand data equally in clusters but by clustering techniques such as K-means clustering, dbscan, Gaussian Mixture Model algorithm, BIRCH algorithm, heirarchial clustering, fuzzy clustering, etc. I want to minimze uneven distribution. The original data distribution shows uneven distribution which I want to minimize. Some people have already done work using the same data applying k-means ++ clustering, I was trying to validate it, then apply other methods.
Walter Roberson
Walter Roberson 2022년 5월 24일
kmeans and dbscan are completely incompetent at making the distribution fair. I believe some of the other algorithms you mentioned are as well.

댓글을 달려면 로그인하십시오.


Shwet Kashyap
Shwet Kashyap 2022년 5월 25일
Hey, it may be they are not able to make a fair distribution which is a subject of research, but one should be able to make clusters using the data given. If we ignore Demand, there must be a way out to create clusters using the lattitude, and longitude. Whereas the kmeans is providing some improvement from the original data, as in in orifginal data some clusters were having zero demand but after k-means clustering all clusters have some demand. The dbscan is a matter of research. Can this data be processed using support vector machine method
regards,
  댓글 수: 11
Walter Roberson
Walter Roberson 2022년 5월 31일
I already explained multiple times that the kmeans algorithm makes absolutely no attempt to balance the number of items in a cluster. Balance is completely outside of the kmeans algorithm.
Walter Roberson
Walter Roberson 2022년 5월 31일
The entire point of kmeans is to group points that are close together, and separate the groups (clusters). If you have a demand of 555 at one location and a distance to a demand of 13 and you ask for two clusters, then it is going to put one at the 13 and the other at the 555, and will not try to split the load.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Programming에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by