generating a sequence 1,2,3,4,....,n

99 ビュー (過去 30 日間)
Rabeya
Rabeya 2012 年 4 月 21 日
回答済み: Arsal noor 2020 年 10 月 22 日
Without using a for loop, how can I generate an index 1,2,3,...,n?

採用された回答

R.U.F.
R.U.F. 2012 年 4 月 21 日
vector=[1:stepsize:n] if the stepsize =1 as in your case, you can disregard it
  1 件のコメント
Jan
Jan 2012 年 4 月 22 日
Following the mlint suggestion, you can omit the square brackets: "1:n"

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

その他の回答 (1 件)

Arsal noor
Arsal noor 2020 年 10 月 22 日
X = [1 2 3 4]

カテゴリ

Help Center および File ExchangeLoops and Conditional Statements についてさらに検索

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by