版本:libsvm3.3
Matlab:R2019b
安装libsvm后运行代码svmtrain函数时候提示svmtrain已被删除, 请改用fitcsvm解,提示和matlab以前版本函数冲突导致,不处理该提示也可正常运行。
libsvm中的svmtrain可能与matlab自带的svmtrain 冲突了。
解决方案:
1.打开libsvm下matlab文件夹,找到make.m文件。
% This make.m is for MATLAB and OCTAVE under Windows, Mac, and Unix
function make()
try
% This part is for OCTAVE
if (exist ('OCTAVE_VERSION', 'builtin'))
mex libsvmread.c
mex libsvmwrite.c
mex -I.. svmtrain.c ../svm.cpp svm_model_matlab.c
mex -I.. svmpredict.c ../svm.cpp svm_model_matlab.c
% This part is for MATLAB
% Add -largeArrayDims on 64-bit machines of MATLAB
else
mex -largeArrayDims libsvmread.c
mex -largeArrayDims libsvmwrite.c
mex -I.. -largeArrayDims svmtrain.c ../svm.cpp svm_model_matlab.c
mex -I.. -largeArrayDims svmpredict.c ../svm.cpp svm_model_matlab.c
end
catch err
fprintf('Error: %s failed (line %d)\n', err.stac