Skip to content

Instantly share code, notes, and snippets.

@dmyersturnbull
Created April 2, 2016 02:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dmyersturnbull/6bf12be28e7f815bd3664d850094d664 to your computer and use it in GitHub Desktop.
Save dmyersturnbull/6bf12be28e7f815bd3664d850094d664 to your computer and use it in GitHub Desktop.
Convert a proprietary .mat file to a more modern HDF5-compatible version 7 .mat file.
using MAT
using Lumberjack
@doc """
Using MAT.jl, converts any MATLAB version >=5 .mat file to an HDF5-compatible MATLAB version 7 .mat file.
Warns if the file already exists.
""" ->
function convert_to_matlab7(input_file:: AbstractString, output_file:: AbstractString)
if ispath(output_file)
warn("File $output_file already exists")
else
data = matread(input_file)
matwrite(output_file, data)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment