Pre-allocating geoshape array

2 visualizaciones (últimos 30 días)
Yoni On
Yoni On el 8 de Dic. de 2019
Editada: Yoni On el 8 de Dic. de 2019
Hi,
I am tring to concatenate a geoshape array in the follwoing manner:
finalShape = geoshape();
for k=1:nodeCount
%some code here...
m_shape = struct('Geometry', 'line','Longitude', str2double (x), 'Latitude', str2double (y));
m_shape_geo = geoshape(m_shape);
%some code here...(adds m_shape_geo adiditonal data)
finalShape = vertcat(finalShape, m_shape_geo);
end
This is very slow funciton, I belive due to missing preallocating.
  1. How do I pre allocate finalshape?
  2. Any other\better way to add geoshapes to array?
Thanks,
Yoni

Respuestas (0)

Categorías

Más información sobre Language Fundamentals en Help Center y File Exchange.

Productos


Versión

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by