资讯

精准传达 • 有效沟通

从品牌网站建设到网络营销策划,从策略到执行的一站式服务

picklefileinmatlab-创新互联

Load pickle files in Matlab

Posted on June 12, 2013 by xcorr  http://xcorr.net/2013/06/12/load-pickle-files-in-matlab/It’s easy enough to load .mat files in Python via the scipy.io.loadmat function. But what about loading .pickle files into Matlab? That’s easy enough by calling a system command in Matlab, like so:picklefileinmatl
ab 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); end

Note 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.

成都创新互联公司专注于原平企业网站建设,成都响应式网站建设公司,商城网站开发。原平网站建设公司,为原平等地区提供建站服务。全流程定制制作,专业设计,全程项目跟踪,成都创新互联公司专业和态度为您提供的服务
当前名称:picklefileinmatlab-创新互联
文章起源:http://www.cdkjz.cn/article/jisih.html
多年建站经验

多一份参考,总有益处

联系快上网,免费获得专属《策划方案》及报价

咨询相关问题或预约面谈,可以通过以下方式与我们联系

大客户专线   成都:13518219792   座机:028-86922220