How to swap columns of matrix zeros(2,n)
1 次查看(过去 30 天)
显示 更早的评论
Hello everyone
I'm working on one project which in need to swap all the columns of the matrix zeros(2,n) which i want to swap the first column with last column, second with second column from last, third column from third column from last and so on can anybody help me with it thank you.
2 个评论
Star Strider
2015-4-22
@Jos — As is the case with a lot of Questions here, I suspect this is a proxy for a different problem.
采纳的回答
更多回答(1 个)
Joseph Cheng
2015-4-22
编辑:Joseph Cheng
2015-4-22
well you can achieve this by
test = randi(10,2,10)
hfliptest = test(:,end:-1:1)
i cant remember if there is a built in function to do this. perhaps someone else knows but this should do it.
**edit oh there it is fliplr.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Logical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!