Borrar filtros
Borrar filtros

dataset expansion keeping same values

2 visualizaciones (últimos 30 días)
Dave Griffin
Dave Griffin el 18 de Jul. de 2017
Editada: alice el 18 de Jul. de 2017
Is it possible to extend a data in the same fashion as c=1 2 3 4 5 to c1 = 1 1 1 1 1 2 2 2 2 2 3 3 3 3 3 4 4 4 4 4 5 5 5 5 5 but on a much larger scale from an array of 144 to an array of 1440

Respuesta aceptada

alice
alice el 18 de Jul. de 2017
Editada: alice el 18 de Jul. de 2017
To transform myArray by repeating its elements nRepeat times:
myArray = 100*rand(1,144); % fake data
nRepeat = 10;
myArrayRepeat = reshape(ones(nRepeat,1)*myArray,1,nRepeat*length(myArray));
or since Matlab R2015a:
myArrayRepeat = repelem(myArray,nRepeat);

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