%% Open and Close File
% Open the badpoem.txt file, read the first line, and then close the file.
%
% Use fopen to open the file. This function assigns a unique file id to use for reading and writing to the file.

fid = fopen('badpoem.txt')

% Read the first line from the file using fgetl.

fgetl(fid)

% Close the file.

fclose(fid);

% Copyright 2012 The MathWorks, Inc.