can anybody tell me the meaning of "end-1" instruction here?thank you.

ptot=15:1024;
sfdr=max(ptot(nper+2:end-1))

1 件のコメント

Image Analyst
Image Analyst 2013 年 4 月 15 日
"end" means the last element in the array, so "end-1" is the next to the last element in the array.

サインインしてコメントする。

 採用された回答

Tobias
Tobias 2013 年 4 月 15 日
編集済み: Tobias 2013 年 4 月 15 日

0 投票

Not knowing what "nper" is makes it a bit more complex to explain, however, sfdr is set to be equal the max value of ptot in the interval going between nper+2 and the 2nd to last value (end-1)

5 件のコメント

lotus
lotus 2013 年 4 月 15 日
nper is an integer..
nper=15;
Tobias
Tobias 2013 年 4 月 15 日
Well, in that case it would be the max value of ptot between 17 and 1023, assuming you do not change your step value.
lotus
lotus 2013 年 4 月 15 日
is it the max value is 1040 for this case?
Tobias
Tobias 2013 年 4 月 15 日
No, the max value in this case would be 1023.
>> ptot = 15:1024;
>> nper = 15;
>> sfdr=max(ptot(nper+2:end-1))
sfdr =
1023
And for (end-2)
sfdr=max(ptot(nper+2:end-2))
sfdr = 1022
And so forth. Do you understand the notation (nper+2:end-1) ? In MATLAB you can process parts of your data, which is denoted as:
variable(rows,columns) or variable(start_value:end_value).
In your case you are telling MATLAB to find the max value in ptot(17:1023). As ptot is simply a count from 15 to 1024, your max value will always be the last one you include in your calculation interval.
lotus
lotus 2013 年 4 月 15 日
ok..now i understand what you meant..thank you.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeMATLAB についてさらに検索

タグ

質問済み:

2013 年 4 月 15 日

Community Treasure Hunt

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

Start Hunting!

Translated by