Hey Everyone,
how would you mak a row vector that goes from 0 to 100 and then back down to 0, by increments of 5?
I know how to make it go from 0 to 100 but back down to 0 by increments of 5 I am lost on.
I think it would of been
v = 0:1:100 , 100: -5: 0
but i'm worng.

 採用された回答

Stephan
Stephan 2020 年 9 月 3 日

1 投票

v = [0:100 ,100:-5:0]

2 件のコメント

Nicholas Deosaran
Nicholas Deosaran 2020 年 9 月 3 日
Thank you I see what I was doing wrong
Stephan
Stephan 2020 年 9 月 3 日
my pleasure.

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

その他の回答 (1 件)

David Hill
David Hill 2020 年 9 月 3 日

1 投票

[0:5:100,95:-5:0];

カテゴリ

ヘルプ センター および File ExchangeMatrix Indexing についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by