Stacking elements of RGB array in a single array

Hello,
i want to read all the elements of 1st coloumn of 'r','g' and 'b' into a single array. i need it to look like how 'col1' looks.
i = imread ('img.png');
r = i(:,:,1);
g = i(:,:,2);
b = i(:,:,3);
col1 = [r(1,1) g(1,1) b(1,1); r(1,2) g(1,2) b(1,2); r(1,3) g(1,3) b(1,3)];

回答(0 个)

类别

帮助中心File Exchange 中查找有关 Matrix Indexing 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by