Question about a:h:b

5 ビュー (過去 30 日間)
Lingbai Ren
Lingbai Ren 2021 年 11 月 10 日
コメント済み: Lingbai Ren 2021 年 11 月 10 日
I have a quick question:
if a=1, h=1, b=5, then a:h:b will turn out to be [1 2 3 4 5]
However, if I want to do backward: b:h:a
it turns out to be a 1*0 empty row vector
is there any possibility we can still equally distribute the space and make b:h:a turns out to be [5 4 3 2 1]?

採用された回答

KSSV
KSSV 2021 年 11 月 10 日
a=1;
h=1;
b=5 ;
l = a:h:b
l = 1×5
1 2 3 4 5
m = b:-h:a
m = 1×5
5 4 3 2 1
  1 件のコメント
Lingbai Ren
Lingbai Ren 2021 年 11 月 10 日
Thanks!

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGet Started with MATLAB についてさらに検索

タグ

製品


リリース

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by