How to populate a matrix automatically by column only?
9 次查看(过去 30 天)
显示 更早的评论
Good day,
This may be a simple question, but I have been searching for this all over but yet to find the answer so here I go.
How do you populate a matrix automatically with intervals but columns only?
For instance, if I type:
A=[0.5:0.2:1.5]
This will generate:
A = 0.5 0.7 0.9 1.1 1.3 1.5
But I would like this matrix to be a single column and not a row?
Thank you in advance,
0 个评论
采纳的回答
Walter Roberson
2018-10-6
You cannot do that directly. Instead, generate a row and transpose it.
A = (0.5:0.2:1.5) .';
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Matrices and Arrays 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!