How do you deal the third dimension of a 3-d array to individual 2-d arrays?

1 回表示 (過去 30 日間)
Jordan Mandel
Jordan Mandel 2018 年 5 月 5 日
コメント済み: Stephen23 2018 年 5 月 6 日
Right now I have
m =imread(image);
red = im(:,:,1);
green = im(:,:,2);
blue = im(:,:,3);
How do I combine the red = ... green =, blue =... steps into one online?
  1 件のコメント
Stephen23
Stephen23 2018 年 5 月 6 日
"How do I combine the red = ... green =, blue =... steps into one online?"
Why do you want to do this? Your code now is simple, neat, and efficient: what is your aim?

サインインしてコメントする。

回答 (1 件)

Ameer Hamza
Ameer Hamza 2018 年 5 月 5 日
編集済み: Ameer Hamza 2018 年 5 月 5 日
Here is a possible way to do that,
im = num2cell(imread(image), [1 2]);
[red, green, blue] = im{:};

Community Treasure Hunt

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

Start Hunting!

Translated by