首页 > 解决方案 > 调整双数组 - Matlab

问题描述

如何调整看起来像这样的边界双数组:

102     8
101     9
100     9
99      9
…       …

要成为一个看起来像这样的双数组:

102   8   101   9   100   9   99   9 … …

代码:

I = imread('coins.png');
BW = im2bw(I, graythresh(I));
[B,L] = bwboundaries(BW,'noholes');
boundary = B{1}

标签: matlab

解决方案


% consider A is your matrix.
At=A.';
At(:)  % this matrix will give what you want.

推荐阅读