I have a matrix 8314 x 3 and want to cut it down to 144 x 3 while having the same start and end point.

 Respuesta aceptada

Ameer Hamza
Ameer Hamza el 25 de Oct. de 2020
Editada: Ameer Hamza el 25 de Oct. de 2020

0 votos

Try this interp1() based solution.
M = rand(8314, 3);
M_new = interp1(linspace(0,1,size(M,1)), M, linspace(0,1,144));

Más respuestas (1)

David Hill
David Hill el 25 de Oct. de 2020

0 votos

Not sure how you want to select the elements between the first and last.
newMatrix=reshape([yourMatrix(1:58:end),yourMatrix(end)],[144],[]);

Categorías

Productos

Versión

R2020a

Etiquetas

Preguntada:

el 25 de Oct. de 2020

Editada:

el 25 de Oct. de 2020

Community Treasure Hunt

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

Start Hunting!

Translated by