Stacking elements of RGB array in a single array
Show older comments
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)];
Answers (0)
Categories
Find more on Matrix Indexing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!