# MATLAB: Bwconncomp returns a variable with 4 fields. one of them is pixelIdxlist. it contains the connected component list.how can we extract each component and show in different images.

connected componentimage processingImage Processing Toolboximage segmentationocr

in my code pixelIdx has 4 components:
 PixelIdxList: {[866x1 double]  [628x1 double]  [1092x1 double]  [4x1 double]}
how can I store each component in a different image so that it can b processed further..
can anyone plz help me to write the code for this..

BW = imread('text.png');CC = bwconncomp(BW);stats = regionprops(CC,'Image');%Display the first component as an imageimshow(stats(1).Image);
stats = regionprops(BW,'Image');