[英]Replace a portion of a vector with another vector
I have a vector of size 20 and a second of size 5. I wish to replace elements 11-15 in the first vector with the second vector. 我有一个大小为20的矢量和一个大小为5的矢量。我希望用第二个矢量替换第一个矢量中的元素11-15。 I can do this by deleting those elements from the first vector and inserting the second vector.
我可以通过从第一个向量中删除这些元素并插入第二个向量来实现。 Is there another way to do this, perhaps by using assign?
有没有其他方法可以做到这一点,也许是通过使用assign?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.