疆括仕网站建设,新征程启航
为企业提供网站建设、域名注册、服务器等服务
function [a] = loadpickle(filename)
if ~exist(filename,'file')
error('%s is not a file',filename);
end
outname = [tempname() '.mat'];
pyscript = ['import cPickle as pickle;import sys;import scipy.io;file=open("' filename '","r");dat=pickle.load(file);file.close();scipy.io.savemat("' outname '",dat)'];
system(['LD_LIBRARY_PATH=/opt/intel/composer_xe_2013/mkl/lib/intel64:/opt/intel/composer_xe_2013/lib/intel64;python -c ''' pyscript '''']);
a = load(outname);
endNote that I’m setting the LD_LIBRARY_PATH environment variable since Matlab seems to reset this variable internally and it causes .so module import errors in Python.
