% Matlab function to plot square arrays from binary data files

function binaryplot(fname);

[fileID,errmsg] = fopen(fname,'r','ieee-le');

if (fileID<0); error(errmsg); end

[m,count] = fread(fileID,1,'int32');
[n,count] = fread(fileID,1,'int32');
[time,count] = fread(fileID,1,'float64');
[A,count] = fread(fileID,[m,n],'float64');

fclose(fileID);

pcolor(A);
colormap('redblue');
shading('interp');
colorbar;
