Borrar filtros
Borrar filtros

Hello everyone, help for consolidation of numbers

1 visualización (últimos 30 días)
SAVAS PAPAGIANNIDIS
SAVAS PAPAGIANNIDIS el 11 de Mzo. de 2019
Comentada: SAVAS PAPAGIANNIDIS el 12 de Mzo. de 2019
Hello everyone,
I would like your help in the following :
How can i convert A = [1,2,3,4,5,6......n] to B = [123,456,......n],........ ???
thanks in advance..!!

Respuesta aceptada

Bob Thompson
Bob Thompson el 12 de Mzo. de 2019
One convoluted way of doing this would be to convert to strings and back.
for i = 1:length(A)/3
B(i) = str2num([num2str(A(3*i-2)),num2str(A(3*i-1)),num2str(A(3*i))]);
end
  1 comentario
SAVAS PAPAGIANNIDIS
SAVAS PAPAGIANNIDIS el 12 de Mzo. de 2019
It's exactly what I wanted, thank you for your gracius response. . ! ! !

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Logical 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