What does this syntax mean?

 Respuesta aceptada

Image Analyst
Image Analyst el 10 de Jul. de 2013
Editada: Image Analyst el 10 de Jul. de 2013

1 voto

It looks like it would be inside an array and mean that it's taking the last 365 elements of the array. E.g.
last365elements = data(end-364:end);

Más respuestas (1)

Evan
Evan el 10 de Jul. de 2013
Editada: Evan el 10 de Jul. de 2013

0 votos

You can index and array with end. End is basically just the length of your variable. So this is saying "index from the 365th from last to the last element of my array."
Example:
>>A = 1:10;
>>A(end-3:end)
ans =
7 8 9 10

Categorías

Preguntada:

el 10 de Jul. de 2013

Community Treasure Hunt

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

Start Hunting!

Translated by