HOW TO MOVE THE DIAGONAL ELEMENTS IN MATRIX (ONE PIXELS) FOR IMAGE PROCESSING
3 次查看(过去 30 天)
显示 更早的评论
HOW TO MOVE THE DIAGONAL ELEMENTS IN MATRIX (ONE PIXELS) FOR IMAGE PROCESSING
2 个评论
采纳的回答
Andrei Bobrov
2012-9-12
编辑:Andrei Bobrov
2012-9-12
I = [1 2 4
2 5 6
1 3 8 ];
ii = 1:size(I,1)+1:numel(I);
I(ii) = I(ii(mod(ii - 2,3)+1));
or
I(eye(size(I))>0) = circshift(diag(I),1);
更多回答(2 个)
Sean de Wolski
2012-9-11
3 个评论
Image Analyst
2012-9-12
Ah - I thought she was like a rescue dog, locating and pulling people from rubble after earthquakes.
另请参阅
类别
在 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!