Skip to content

Latest commit

 

History

History
27 lines (21 loc) · 955 Bytes

README.md

File metadata and controls

27 lines (21 loc) · 955 Bytes

fb-mattorch: Read and write Matlab files (without Matlab)

This is an alternative to the mattorch package that provides a subset of functionality (it only permits reading and writing of Matlab files) but does not require that you have Matlab installed; it uses the open-source MAT File I/O Library instead.

Usage

local mattorch = require('fb.mattorch')

-- Load all variables from a Matlab file; returns a table of the form
-- {name = value}, where values are torch Tensors
local vars = mattorch.load('foo.mat')

-- Save all variables from a Matlab file; given a table of the form
-- {name = value}, where values are torch Tensors, writes them to
-- a Matlab file
mattorch.save('bar.mat', vars)

-- Save one single tensor to a Matlab file under the uninspired name 'x'
-- equivalent to mattorch.save('baz.mat', {x = var})
mattorch.save('baz.mat', var)