Borrar filtros
Borrar filtros

store last m elemnts of a matrix to another matrix

1 visualización (últimos 30 días)
Hi all, is there any MATLAB function to store the last m elemnts of a matrix to another matrix?
Thanks

Respuesta aceptada

Sean de Wolski
Sean de Wolski el 24 de Feb. de 2012
B = A(end-(m-1):end);

Más respuestas (1)

Krishnendu Mukherjee
Krishnendu Mukherjee el 24 de Feb. de 2012
suppose A=[1 2 3 4 5 6 7 8 9 10] last 2 element are to be stored i=1; for j=m:size(A(1,:)) Anew(1,i)=A(1,j) end
this is if your matrix is of one row. but u hv nt mention the dimension of the matrix

Categorías

Más información sobre Matrices and Arrays en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by