%% Determine Default File Encoding
% This example shows how to determine the default encoding for your computer.
%
% Open any text file without specifying the encoding. patients.dat is a sample text file that ships with MATLAB.

fileID = fopen('patients.dat');

%
% Call fopen again with fileID as the input. Request the fourth output argument.

[~,~,~,encodingOut] = fopen(fileID)

% The encodingOut output argument is your computer's default encoding.
%
% Close the text file.

fclose(fileID);

% Copyright 2015 The MathWorks, Inc.