Files
MachineLearningCoursera/machine-learning-ex6/ex6/readFile.m
julien Lengrand-Lambert 8c6997b185 Starting to work on Week 7.
Yeah i know i'm super late.
Those weeks go way to fast.
2015-12-19 18:25:05 +01:00

19 lines
396 B
Matlab

function file_contents = readFile(filename)
%READFILE reads a file and returns its entire contents
% file_contents = READFILE(filename) reads a file and returns its entire
% contents in file_contents
%
% Load File
fid = fopen(filename);
if fid
file_contents = fscanf(fid, '%c', inf);
fclose(fid);
else
file_contents = '';
fprintf('Unable to open %s\n', filename);
end
end