首先来看官网的安装指南
https://www.vlfeat.org/matconvnet/quick/
% Install and compile MatConvNet (needed once).
untar('http://www.vlfeat.org/matconvnet/download/matconvnet-1.0-beta25.tar.gz') ;
cd matconvnet-1.0-beta25
run matlab/vl_compilenn ;
% Download a pre-trained CNN from the web (needed once).
urlwrite(...
'http://www.vlfeat.org/matconvnet/models/imagenet-vgg-f.mat', ...
'imagenet-vgg-f.mat') ;
% Setup MatConvNet.
run matlab/vl_setupnn ;
% Load a model and upgrade it to MatConvNet current version.
net = load('imagenet-vgg-f.mat') ;
net = vl_simplenn_tidy(net) ;
% Obtain and preprocess an image.
im = imread('peppers.png') ;
im_ = single(im) ; % note: 255 range
im_ = imresize(im_, net.meta.normalization.imageSize(1:2)) ;
im_ = im_ - net.meta.normalization.averageImage ;
% Run the CNN.
res = vl_simplenn(net, im_) ;
% Show the classification result.
scores = squeeze(gather(res(end).x)) ;