Skip to content

Instantly share code, notes, and snippets.

@bermanmaxim
Created October 16, 2015 11:51
Show Gist options
  • Save bermanmaxim/f64e459e6d286e7f6888 to your computer and use it in GitHub Desktop.
Save bermanmaxim/f64e459e6d286e7f6888 to your computer and use it in GitHub Desktop.
Using jlcall.jl to save Matlab variables to Julia JLD In Matlab
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
@bermanmaxim
Copy link
Author

for a matlab variable named x, save_jld("file.jld", x) will save x in file.jld under the name "x". Inputs must be named variables for this to work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment