how to interchange array elements
3 次查看(过去 30 天)
显示 更早的评论
my input is x=[11 12 13 14 15]. my output should be y=[15 12 13 14 11]. how to interchange particular values without disturbing other elements.?
0 个评论
回答(2 个)
Honglei Chen
2013-3-28
Not sure if this is what you are looking for, but here is one way to do it, as long as you know the order
y = x([5 2 3 4 1])
2 个评论
另请参阅
类别
在 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!