How to specify a number to the specified position in the array?
3 次查看(过去 30 天)
显示 更早的评论

0 个评论
采纳的回答
更多回答(1 个)
the cyclist
2019-10-13
编辑:the cyclist
2019-10-13
There's probably not an built-in function that does just that, but it's easy to do it with basic array manipulations. Here is one way.
newData = 1:20; % Your example "new" data
newNewData = [newData(1:10); newData(20:-1:11)]; % Make even newer data, temporarily in 2-d array
newNewData = newNewData(:)' % Make the newer data into a row array
5 个评论
the cyclist
2019-10-14
编辑:the cyclist
2019-10-14
When you say "random", do you mean the length of the vector is random? Or that the values in the vector are random?
If your data is
[2 3 5 7 11]
what would you want the output to be?
另请参阅
类别
在 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!