用matlab做图像处理,现在需要将图像[m*n]坐标转存到两个列向量[mn*2],每个列向量存的是图像各个点的坐标。
例:
3*3的img,他的坐标为
(1,1
1,2
1,3
2,1
2,2
2,3
3,1
3,2
3,3)
第二列的123 123 123可以用repmat得到,而像第一列 111 222 333应该如何实现(图像较大,for循环比较费时:'( )
希望路过的朋友们帮帮我:hug:

 採用された回答

0 投票

[repelem(1:3,3)',repmat([1:3]',3,1)]
如果你的版本低,没有repelem,就都用repmeat

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File Exchange で Convert Image Type についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!