how to select last elements of a row vector?
42 ビュー (過去 30 日間)
古いコメントを表示
Hi all,
I have a row vector:
j = [593,660,725,790,854,919,984,1050,1118,1184, 1300, 1400, 1500, 1600]
I want to select last 5 elements.
j_last5 = j(1,end-5);
gives me 1118
but I want : j_last 5 = [1184, 1300, 1400, 1500, 1600]
Can you help please?
0 件のコメント
採用された回答
その他の回答 (1 件)
Davide Masiello
2022 年 3 月 8 日
j = [593,660,725,790,854,919,984,1050,1118,1184, 1300, 1400, 1500, 1600];
j_last5 = j(end-4:end)
j_last5 =
1184 1300 1400 1500 1600
0 件のコメント
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!