create non uniform increment vector

3 ビュー (過去 30 日間)
Oday Shahadh
Oday Shahadh 2020 年 6 月 12 日
回答済み: KSSV 2020 年 6 月 12 日
hi
how can I in a single command creat this vector:
a=12345678910987654321
thanks

回答 (2 件)

Robin Kirsch
Robin Kirsch 2020 年 6 月 12 日
編集済み: Robin Kirsch 2020 年 6 月 12 日
a = [1:10 9:-1:1]
a =
Columns 1 through 13
1 2 3 4 5 6 7 8 9 10 9 8 7
Columns 14 through 19
6 5 4 3 2 1

KSSV
KSSV 2020 年 6 月 12 日
k = num2str([1:10 9:-1:1]) ;
k(k == ' ') = [] ;
k

カテゴリ

Help Center および File ExchangeMatrices and Arrays についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by