Help Formatting Vector To Not Include Starting Point
14 次查看(过去 30 天)
显示 更早的评论
I am trying to create a vector of linearly spaced numbers, but not including zero (but I need to start from zero).. Say I wanted five linearly spaced numbers from zero to two (and including two), but not including zero, how would I go about this? As far as I am aware, linspace always includes the starting point, right? Thank you!
0 个评论
采纳的回答
Stephen23
2018-6-6
N = 5;
vec = linspace(0,2,N+1);
vec = vec(2:N);
2 个评论
Bailey Smith
2018-6-6
I still need it to include the end point, just not the starting point. This only gives me 4 points instead of 5.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Creating and Concatenating Matrices 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!