Borrar filtros
Borrar filtros

Array slice indexing?

283 visualizaciones (últimos 30 días)
Nour Salhab
Nour Salhab el 13 de Nov. de 2017
Respondida: Mohammed Hamaidi el 22 de Mzo. de 2022
Hey
please explain what the following function does :
y=a(i,end:-1:1);
if you could give me an example that would be great! thank you

Respuestas (2)

the cyclist
the cyclist el 13 de Nov. de 2017
Editada: the cyclist el 13 de Nov. de 2017
It returns the ith row of a, in right-to-left order.
You might want to study Getting Started with MATLAB.

Mohammed Hamaidi
Mohammed Hamaidi el 22 de Mzo. de 2022
Take for example:
a=[1 2 3; 5 6 7; 8 9 12]
and
i=2
then
a(i,end:-1:1)
gives: the 2nd row in right to left order (the elements of the 2nd row from right to left)
ie: 7 6 5

Categorías

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