%% Read Entire File of Double-Precision Data
% Create a file named doubledata.bin, containing nine double-precision values.

fileID = fopen('doubledata.bin','w');
fwrite(fileID,magic(3),'double');
fclose(fileID);

%
% Open the file, doubledata.bin, and read the data in the file into a 3-by-3 array, A. Specify that the source data is class double.

fileID = fopen('doubledata.bin');
A = fread(fileID,[3 3],'double')

%
% Close the file.

fclose(fileID);

% Copyright 2015 The MathWorks, Inc.