我有一个需要在MATLAB中调用的python函数,该函数从scipy.signal导入函数。
但是,当我尝试在MATLAB中调用该函数时,会出现错误
Error using arpack><module> (line 45)
Python Error: ImportError: DLL load failed: The specified procedure could not be found.
Error in __init__><module> (line 22)
from .arpack import *
Error in __init__><module> (line 11)
from .arpack import *
Error in __init__><module> (line 117)
from .eigen import *
Error in _minimize><module> (line 21)
from scipy.sparse.linalg import LinearOperator
Error in __init__><module> (line 271)
from ._minimize import *
Error in filter_design><module> (line 18)
from scipy import special, optimize, fftpack
Error in __init__><module> (line 321)
from .filter_design import *
Error in <frozen importlib>_call_with_frames_removed (line 219)
Error in <frozen importlib>exec_module (line 728)
Error in <frozen importlib>_load_unlocked (line 677)
Error in <frozen importlib>_find_and_load_unlocked (line 967)
Error in <frozen importlib>_find_and_load (line 983)
Error in <frozen importlib>_gcd_import (line 1006)
Error in __init__>import_module (line 127)
return _bootstrap._gcd_import(name[level:], package, level)
在从MATLAB调用python函数或仅通过键入
py.importlib.import_module('scipy.signal')
在MATLAB命令行中。尝试直接调用scipy.signal函数
py.scipy.signal.find_peaks()
引发错误
Undefined variable "py" or class "py.scipy.signal.find_peaks".
另一方面,导入(或调用)numpy,scipy或numpy子模块都是成功的。
是scipy.signal子模块不能在MATLAB中调用,还是我错过了什么?
答案 0 :(得分:1)
您应该能够使用以下语法调用scipy.signal函数,例如
myButterFilt = py.scipy.signal.butter(1,0.25)