How can I change pairs?
2 次查看(过去 30 天)
显示 更早的评论
I have pairs of A{i}=[ai bi]. How can I change them to pairs B{i}=[bi ai]. I like to use Matlab special features in matrices.
0 个评论
采纳的回答
Jos (10584)
2014-1-23
% the data
A = {[1 2], [3 4] , [5 6]}
% the insight
help fliplr
help cellfun
% the engine
B = cellfun(@fliplr, A, 'un', 0)
0 个评论
更多回答(1 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Cell Arrays 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!