Create array with same number
576 次查看(过去 30 天)
显示 更早的评论
I have this command z=ones(length(x),1) If I want to change (ones) with 2 or 3 what I should do?
0 个评论
采纳的回答
James Tursa
2018-9-14
编辑:James Tursa
2018-9-14
See this link for a discussion of various methods to do this:
The fastest method seems to be
z = zeros(length(x),1) + 2;
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!