What does this syntax mean?

2 ビュー (過去 30 日間)
Alberto
Alberto 2013 年 7 月 10 日
Can you explain to me what does it mean this syntax end-364:end? Thank you

採用された回答

Image Analyst
Image Analyst 2013 年 7 月 10 日
編集済み: Image Analyst 2013 年 7 月 10 日
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);

その他の回答 (1 件)

Evan
Evan 2013 年 7 月 10 日
編集済み: Evan 2013 年 7 月 10 日
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

カテゴリ

Help Center および File ExchangeShifting and Sorting Matrices についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by