1function file_contents = readFile(filename) 2%READFILE reads a file and returns its entire contents 3% file_contents = READFILE(filename) reads a file and returns its entire 4% contents in file_contents 5% 6 7% Load File 8fid = fopen(filename); 9if fid 10 file_contents = fscanf(fid, '%c', inf); 11 fclose(fid); 12else 13 file_contents = ''; 14 fprintf('Unable to open %s\n', filename); 15end 16 17end 18 19 20