但在python调用
输入不同,但输出永远是同一个
python调用
def bp_matlab(a,b,c,d,e,f,g,h):
list1=[a,b,c,d,e,f,g,h]
import matlab.engine
eng = matlab.engine.start_matlab()
a=list1
a = matlab.double(list1)
# eng.workspace['tmp1'] = a
result=eng.bpffa(a) #将readmat当作m脚本运行,nargout=0表示无输出参数,默认为1。
# print('result',result)
return result
matlab开头
function result= bpffa(tmp)
values=tmp;
clc
clearvars -except values
close all
tic
bp代码