Created
October 16, 2015 11:51
-
-
Save bermanmaxim/f64e459e6d286e7f6888 to your computer and use it in GitHub Desktop.
Using jlcall.jl to save Matlab variables to Julia JLD In Matlab
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function save_jld( file, varargin ) | |
Jl.eval('using JLD') | |
arguments = cell(2*length(varargin), 1); | |
for ii = 1:length(varargin) | |
arguments{2*(ii-1) + 1} = inputname(1 + ii); | |
arguments{2*(ii-1) + 2} = varargin{ii}; | |
end | |
Jl.call('save', file, arguments{:}); | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
for a matlab variable named
x
,save_jld("file.jld", x)
will savex
infile.jld
under the name"x"
. Inputs must be named variables for this to work.