Cody

# Problem 42617. List of built-in demo images

Solution 772242

Submitted on 5 Nov 2015 by Alfonso Nieto-Castanon
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

### Test Suite

Test Status Code Input and Output
1   Pass
%% filetext = fileread('demoimages.m'); assert(isempty(strfind(filetext, 'cameraman.tif')))

2   Pass
%% c = demoimages({'.png'}); c_correct = {'bag.png','blobs.png','circles.png','circlesBrightDark.png','coins.png','coloredChips.png','concordaerial.png','concordorthophoto.png','fabric.png','gantrycrane.png','glass.png','hestain.png','kobi.png','liftingbody.png','lighthouse.png','onion.png','pears.png','pillsetc.png','rice.png','riceblurred.png','saturn.png','snowflakes.png','tape.png','testpat1.png','text.png','tissue.png','toyobjects.png','toysflash.png','toysnoflash.png','westconcordaerial.png','westconcordorthophoto.png'}; assert(isequal(c,c_correct))

files = 31x1 struct array with fields: name date bytes isdir datenum

3   Pass
%% c = demoimages({'.jpg'}); c_correct = {'football.jpg','greens.jpg','hands1.jpg','hands2.jpg','office_1.jpg','office_2.jpg','office_3.jpg','office_4.jpg','office_5.jpg','office_6.jpg','yellowlily.jpg'}; assert(isequal(c,c_correct))

files = 11x1 struct array with fields: name date bytes isdir datenum

4   Pass
%% c = demoimages({'.bmp','.jpg'}); c_correct = {'football.jpg','greens.jpg','hands1.jpg','hands2.jpg','office_1.jpg','office_2.jpg','office_3.jpg','office_4.jpg','office_5.jpg','office_6.jpg','yellowlily.jpg'}; assert(isequal(c,c_correct))

files = 0x1 struct array with fields: name date bytes isdir datenum files = 11x1 struct array with fields: name date bytes isdir datenum

5   Pass
%% c = demoimages({'.tif'}); c_correct = {'AT3_1m4_01.tif','AT3_1m4_02.tif','AT3_1m4_03.tif','AT3_1m4_04.tif','AT3_1m4_05.tif','AT3_1m4_06.tif','AT3_1m4_07.tif','AT3_1m4_08.tif','AT3_1m4_09.tif','AT3_1m4_10.tif','autumn.tif','board.tif','cameraman.tif','canoe.tif','cell.tif','circbw.tif','circuit.tif','eight.tif','forest.tif','hotcoffee.tif','kids.tif','logo.tif','m83.tif','mandi.tif','moon.tif','mri.tif','paper1.tif','pout.tif','shadow.tif','spine.tif','tire.tif','trees.tif'}; assert(isequal(c,c_correct))

files = 32x1 struct array with fields: name date bytes isdir datenum

6   Pass
%% c = demoimages({'.tif','.png'}); c_correct = {'AT3_1m4_01.tif','AT3_1m4_02.tif','AT3_1m4_03.tif','AT3_1m4_04.tif','AT3_1m4_05.tif','AT3_1m4_06.tif','AT3_1m4_07.tif','AT3_1m4_08.tif','AT3_1m4_09.tif','AT3_1m4_10.tif','autumn.tif','board.tif','cameraman.tif','canoe.tif','cell.tif','circbw.tif','circuit.tif','eight.tif','forest.tif','hotcoffee.tif','kids.tif','logo.tif','m83.tif','mandi.tif','moon.tif','mri.tif','paper1.tif','pout.tif','shadow.tif','spine.tif','tire.tif','trees.tif','bag.png','blobs.png','circles.png','circlesBrightDark.png','coins.png','coloredChips.png','concordaerial.png','concordorthophoto.png','fabric.png','gantrycrane.png','glass.png','hestain.png','kobi.png','liftingbody.png','lighthouse.png','onion.png','pears.png','pillsetc.png','rice.png','riceblurred.png','saturn.png','snowflakes.png','tape.png','testpat1.png','text.png','tissue.png','toyobjects.png','toysflash.png','toysnoflash.png','westconcordaerial.png','westconcordorthophoto.png'}; assert(isequal(c,sort(c_correct)))

files = 32x1 struct array with fields: name date bytes isdir datenum files = 31x1 struct array with fields: name date bytes isdir datenum

7   Pass
%% c = demoimages({'.jpg','.png','.tif'}); c_correct = {'football.jpg','greens.jpg','hands1.jpg','hands2.jpg','office_1.jpg','office_2.jpg','office_3.jpg','office_4.jpg','office_5.jpg','office_6.jpg','yellowlily.jpg','bag.png','blobs.png','circles.png','circlesBrightDark.png','coins.png','coloredChips.png','concordaerial.png','concordorthophoto.png','fabric.png','gantrycrane.png','glass.png','hestain.png','kobi.png','liftingbody.png','lighthouse.png','onion.png','pears.png','pillsetc.png','rice.png','riceblurred.png','saturn.png','snowflakes.png','tape.png','testpat1.png','text.png','tissue.png','toyobjects.png','toysflash.png','toysnoflash.png','westconcordaerial.png','westconcordorthophoto.png','AT3_1m4_01.tif','AT3_1m4_02.tif','AT3_1m4_03.tif','AT3_1m4_04.tif','AT3_1m4_05.tif','AT3_1m4_06.tif','AT3_1m4_07.tif','AT3_1m4_08.tif','AT3_1m4_09.tif','AT3_1m4_10.tif','autumn.tif','board.tif','cameraman.tif','canoe.tif','cell.tif','circbw.tif','circuit.tif','eight.tif','forest.tif','hotcoffee.tif','kids.tif','logo.tif','m83.tif','mandi.tif','moon.tif','mri.tif','paper1.tif','pout.tif','shadow.tif','spine.tif','tire.tif','trees.tif'}; assert(isequal(c,sort(c_correct)))

files = 11x1 struct array with fields: name date bytes isdir datenum files = 31x1 struct array with fields: name date bytes isdir datenum files = 32x1 struct array with fields: name date bytes isdir datenum

8   Pass
%% assert(isempty(demoimages({'.bmp'})))

files = 0x1 struct array with fields: name date bytes isdir datenum

9   Pass
%% assert(isempty(demoimages({'.gif'})))

files = 0x1 struct array with fields: name date bytes isdir datenum

10   Pass
%% c = demoimages({'.bmp','.gif','.tif','.png','.jpg'}); c_correct = {'AT3_1m4_01.tif','AT3_1m4_02.tif','AT3_1m4_03.tif','AT3_1m4_04.tif','AT3_1m4_05.tif','AT3_1m4_06.tif','AT3_1m4_07.tif','AT3_1m4_08.tif','AT3_1m4_09.tif','AT3_1m4_10.tif','autumn.tif','board.tif','cameraman.tif','canoe.tif','cell.tif','circbw.tif','circuit.tif','eight.tif','forest.tif','hotcoffee.tif','kids.tif','logo.tif','m83.tif','mandi.tif','moon.tif','mri.tif','paper1.tif','pout.tif','shadow.tif','spine.tif','tire.tif','trees.tif','bag.png','blobs.png','circles.png','circlesBrightDark.png','coins.png','coloredChips.png','concordaerial.png','concordorthophoto.png','fabric.png','gantrycrane.png','glass.png','hestain.png','kobi.png','liftingbody.png','lighthouse.png','onion.png','pears.png','pillsetc.png','rice.png','riceblurred.png','saturn.png','snowflakes.png','tape.png','testpat1.png','text.png','tissue.png','toyobjects.png','toysflash.png','toysnoflash.png','westconcordaerial.png','westconcordorthophoto.png','football.jpg','greens.jpg','hands1.jpg','hands2.jpg','office_1.jpg','office_2.jpg','office_3.jpg','office_4.jpg','office_5.jpg','office_6.jpg','yellowlily.jpg'}; assert(isequal(c,sort(c_correct)))

files = 0x1 struct array with fields: name date bytes isdir datenum files = 0x1 struct array with fields: name date bytes isdir datenum files = 32x1 struct array with fields: name date bytes isdir datenum files = 31x1 struct array with fields: name date bytes isdir datenum files = 11x1 struct array with fields: name date bytes isdir datenum