Range of values using increments

39 ビュー (過去 30 日間)
Andy Valle
Andy Valle 2021 年 4 月 29 日
編集済み: DGM 2021 年 4 月 29 日
Can someone explain to me how I can come up with a way to create a sequence of numbers starting from 0, and incrementing by say 5, and stopping at a certain specified number say 20? I know how to do this in coding languages like python but is it possible to do this in matlab? in python it would be something simple like
if i in range(0,5,20):

回答 (1 件)

DGM
DGM 2021 年 4 月 29 日
編集済み: DGM 2021 年 4 月 29 日
If you want a specific spacing:
x = startnum:stepsize:endnum
for example:
0:5:20
gives
ans =
0 5 10 15 20

カテゴリ

Help Center および File ExchangeCall Python from MATLAB についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by