Matlab multiple segments extraction
Ältere Kommentare anzeigen
I am dealing with some matlab issue. Can someone help?
Suppose i have a sequence: A=[1 2 3 4 29 31 0 0 0 0 0 35 4 5 61 7 0 0 0 1 2 31 91 65], i need to extract nonzero segments seperately. For eg: my output should be s1=[1 2 3 4 29 31]; s2=[35 4 5 61 7]; s3=[1 2 31 91 65].
Akzeptierte Antwort
Weitere Antworten (2)
Do you have the Image Processing Toolbox? If so, just use regionprops(...,'PixelIdx')
Otherwise,
1 Kommentar
Sunil
am 6 Okt. 2012
Sunil
am 6 Okt. 2012
Bearbeitet: Image Analyst
am 6 Okt. 2012
0 Stimmen
1 Kommentar
Image Analyst
am 6 Okt. 2012
Nothing simple comes to mind. You could try the brute force / intuitive way of using for loops to find the regions and using cell arrays to store the regions once you've found them. I guess you could consider that simple but it will be several lines of code.
Kategorien
Mehr zu Correlation and Convolution finden Sie in Hilfe-Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!