Making a row vector

23 次查看(过去 30 天)
Nicholas Deosaran
评论: Stephan 2020-9-3
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
v = [0:100 ,100:-5:0]
  2 个评论
Nicholas Deosaran
Thank you I see what I was doing wrong
Stephan
Stephan 2020-9-3
my pleasure.

请先登录,再进行评论。

更多回答(1 个)

David Hill
David Hill 2020-9-3
[0:5:100,95:-5:0];

类别

Help CenterFile Exchange 中查找有关 Creating and Concatenating Matrices 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by