%Dear users,
%Imagine that I have a matrix of A=[1,2,3,4,5]
%Is there any short-cut to get the matrix of B=[5,4,3,2,1]?
%Thanks in advance

 Respuesta aceptada

Joel Handy
Joel Handy el 5 de Ag. de 2019

0 votos

A = [1 2 3 4 5];
B = fliplr(A) % Flip matrix in left/right direction
A = [1; 2; 3; 4; 5];
B = flipud(A) % Flip matrix in up/down direction

Categorías

Más información sobre Matrices and Arrays en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 5 de Ag. de 2019

Respondida:

el 5 de Ag. de 2019

Community Treasure Hunt

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

Start Hunting!

Translated by