How to plot 2D location vs corresponding data in MATLAB

12 ビュー (過去 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 Center および File ExchangeProgramming についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by