How to store the different sizes of vectors ?

5 visualizaciones (últimos 30 días)
Naga A
Naga A el 27 de Oct. de 2015
Comentada: Naga A el 29 de Oct. de 2015
Hello,
I'm working on the following problem. It consists of hexagons with base stations(center red star) and mobile (blue dots).I want to store the coordinates of the mobile users in each hexagon. I'm trying to use the Inpolygon funtion to check whether the points are in the required hexagon or not.I write the code like this:
for i=1:Hexagons_total
IN = inpolygon(user_x,user_y,Hex_cord(i,1:7),Hex_cord(i,8:14));
m_c_x=user_x(IN);
m_c_y=user_y(IN);
m_c=[m_c_x;m_c_y];
end
how to store the coordinates of each hexagon.Suppose if i want to assign the matrix,the size varies from one hexagon to another(because the users are random in each hexagon). Can you guys help me how to store them?Because later I need to add some more mobile users to some hexagons.

Respuesta aceptada

Nick Hobbs
Nick Hobbs el 29 de Oct. de 2015
I understand you want to store vectors of different sizes. One option for this is to use a cell array. Please refer to the following link for more information on cell arrays.

Más respuestas (0)

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by