21-Jan-2019 10:29:10 FILUM_TEST MATLAB version Test FILUM. TEST02 FILE_CHAR_COUNT counts the characters in a file. Examining file: "story.txt". Number of characters in file: 566 FILUM_TEST03 FILE_COLUMN_COUNT counts the columns in a file. It is assumed that the file contains a number of lines, with each line containing the same number of words. The task is to determine the number of words in a line, that is, the number of "columns" of text. Examining the file "filum_test_4by5.txt" Number of columns = 5 TEST06 FILE_EXIST is true if a file exists. Exist? FILENAME 1 filum_test.m 1 filum.html 0 rabbit.txt 0 make.money.fast TEST085 FILE_LINE_WIDTH counts the longest line in a file. Examining file: "story.txt". Longest line length: 52 TEST11 FILENAME_DEC decrements a string Input Output file???.dat (Empty output string. Quit loop!) file072.dat file071.dat file071.dat file070.dat file070.dat file069.dat 2cat9.dat 2cat8.dat 2cat8.dat 2cat7.dat 2cat7.dat 2cat6.dat fred99.txt fred98.txt fred98.txt fred97.txt fred97.txt fred96.txt TEST13 FILENAME_EXT_SWAP changes a file extension. Input Output FILENAME EXT FILENAME bob.for obj bob.obj bob.bob.bob txt bob.bob.txt bob. yak bob.yak bob ps bob .ps .oops eek .eek TEST14 FILENAME_INC increments a string Input Output file???.dat (Empty output string. Quit loop!) file072.dat file073.dat file073.dat file074.dat file074.dat file075.dat file075.dat file076.dat 2cat9.dat 3cat0.dat 3cat0.dat 3cat1.dat 3cat1.dat 3cat2.dat 3cat2.dat 3cat3.dat fred98.txt fred99.txt fred99.txt fred00.txt fred00.txt fred01.txt fred01.txt fred02.txt TEST15 FILENAME_INC "increments" a string. In this example, the string is a file name. The user is going to carry out several simulations. For each simulation, a consecutive series of file names is desired. Begin simulation 1 file_01_001.txt file_01_002.txt file_01_003.txt file_01_004.txt Begin simulation 2 file_02_001.txt file_02_002.txt file_02_003.txt file_02_004.txt Begin simulation 3 file_03_001.txt file_03_002.txt file_03_003.txt file_03_004.txt Begin simulation 4 file_04_001.txt file_04_002.txt file_04_003.txt file_04_004.txt Begin simulation 5 file_05_001.txt file_05_002.txt file_05_003.txt file_05_004.txt TEST165 FILENAME_INC_NOWRAP increments a string but does not allow "wrapping". Input Output file???.dat (Empty output string. Quit loop!) file072.dat file073.dat file073.dat file074.dat file074.dat file075.dat file075.dat file076.dat 2cat9.dat 3cat0.dat 3cat0.dat 3cat1.dat 3cat1.dat 3cat2.dat 3cat2.dat 3cat3.dat fred98.txt fred99.txt fred99.txt (Empty output string. Quit loop!) TEST17 FILE_PARA_COUNT counts the paragraphs in a file. Examining file: "story.txt". Number of paragraphs: 6 FILUM_TEST22 FILE_ROW_COUNT counts the rows in a file. Examining the file "filum_test_data.txt" Number of rows = 16 TEST225 FILE_SEQUENCE_SIZE "sizes" the files in a file sequence. Examining files in sequence starting with: "data_100.txt". Number of files: 3 Number of data items: 8 MARCUS_TEST MATLAB version Show how to save iterative data in files with incremented names; Show how to retrieve data by reading the files in in reverse order. The routines we use are: FILENAME_INC: increments a file name; FILENAME_DEC: decrements a file name; Generate and save the data: I X Y Z(1) Z(2) fred001.mat 1 1.000000 1.000000 0.391880 0.191378 fred002.mat 2 2.000000 4.000000 0.779100 0.655361 fred003.mat 3 3.000000 9.000000 0.839791 0.914772 fred004.mat 4 4.000000 16.000000 0.416548 0.862366 fred005.mat 5 5.000000 25.000000 0.706295 0.482803 fred006.mat 6 6.000000 36.000000 0.875303 0.864312 fred007.mat 7 7.000000 49.000000 0.906350 0.716023 fred008.mat 8 8.000000 64.000000 0.711989 0.861421 fred009.mat 9 9.000000 81.000000 0.802498 0.302965 fred010.mat 10 10.000000 100.000000 0.308005 0.301902 Recover the data in reverse order: I X Y Z(1) Z(2) fred010.mat 10 10.000000 100.000000 0.308005 0.301902 fred009.mat 9 9.000000 81.000000 0.802498 0.302965 fred008.mat 8 8.000000 64.000000 0.711989 0.861421 fred007.mat 7 7.000000 49.000000 0.906350 0.716023 fred006.mat 6 6.000000 36.000000 0.875303 0.864312 fred005.mat 5 5.000000 25.000000 0.706295 0.482803 fred004.mat 4 4.000000 16.000000 0.416548 0.862366 fred003.mat 3 3.000000 9.000000 0.839791 0.914772 fred002.mat 2 2.000000 4.000000 0.779100 0.655361 fred001.mat 1 1.000000 1.000000 0.391880 0.191378 FILUM_TEST Normal end of execution. 21-Jan-2019 10:29:10