Borrar filtros
Borrar filtros

error horzcat CAT arguments dimensions

1 visualización (últimos 30 días)
joo
joo el 14 de Nov. de 2012
does anyone understand why am i getting this error:
??? Error using ==> horzcat CAT arguments dimensions are not consistent. Error in ==> code at 60 peaksK = [distancesK(1), peakssK, distancesK(end)];
when using this code:
(distancesK = 582x1 double)
[peakssK, iPeakssK] = findpeaks(distancesK);
peaksK = [distancesK(1), peakssK, distancesK(end)];
i have already used this code million times but now it is giving me this error. can anyone help me please? thank you very much.

Respuesta aceptada

Andrei Bobrov
Andrei Bobrov el 14 de Nov. de 2012
Editada: Andrei Bobrov el 14 de Nov. de 2012
peaksK = [distancesK(1); peakssK(:); distancesK(end)];
or
peaksK = [distancesK(1), peakssK(:).', distancesK(end)];
  2 comentarios
Jan
Jan el 14 de Nov. de 2012
Or:
peaksK = [distancesK; peakssK; distancesK(end)];
joo
joo el 14 de Nov. de 2012
thank you so much for the both of you.it worked like this. thank you.
peaksK = [distancesK(1), peakssK.', distancesK(end)];
iPeaksK = [1, iPeakssK.', length(distancesK)];

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Creating and Concatenating Matrices 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