Borrar filtros
Borrar filtros

save a vector in an array

1 visualización (últimos 30 días)
Rica
Rica el 6 de Nov. de 2012
Hi! I have this loop and i want to save the index (ind) in a vector or array. How should i do this
i thougt about a=[a;ind], but it was not true.
%code
for l=1:length(date_time_l)
[~, ind] = min(abs(numdates-(date_time_l(l))));
end
%end of code
i thougt about a=[a;ind], but it was not true.
thank you

Respuesta aceptada

Thomas
Thomas el 6 de Nov. de 2012
try
for ii =1:length(date_time_l)
[~, ind(ii)] = min(abs(numdates-(date_time_l(ii))));
end

Más respuestas (0)

Categorías

Más información sobre Text Data Preparation en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by