Copy numbers vector to vector
显示 更早的评论
Hello! If I have a vector and I need to copy some numbers from another vector how can I do it?
For example, this is what I've done:
graph1= zeros(1:100)
i1=50
i2=55
I(i1:i2)=v1(240:245)
v1= v1 is another vector and I want to copy in the 'graph1' (on the positions 50 to 51), the numbers of the vector v1 in the position 240:245.
thanks a lot,
采纳的回答
更多回答(1 个)
venkat vasu
2012-8-3
0 个投票
graph1(50:0.2:51)=v1(240:245);
3 个评论
venkat vasu
2012-8-3
i think you want to insert from 240-245th position vector in b/w 50-51 position. so in b/w 50-51 like that only we can insert the vector.
Walter Roberson
2012-8-10
It is not possible to use non-integral subscripts for a vector, so this code will not work.
类别
在 帮助中心 和 File Exchange 中查找有关 Programming 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!