How to plot 2D location vs corresponding data in MATLAB
16 views (last 30 days)
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.
KSSV on 18 May 2022
Edited: KSSV on 18 May 2022
REad abour kmeans
T = readtable('https://in.mathworks.com/matlabcentral/answers/uploaded_files/999455/MATLAB.xlsx')
x = T.(1) ;
y = T.(2) ;
d = T.(3) ;
idx = kmeans([x y d],71) ;
cmap = turbo(71) ;
Walter Roberson on 18 May 2022
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.