Undefined function or variable 'rootFolder'.

When I am training to implement this function
imageDatastore
I receive
Undefined function or variable 'rootFolder'.
I have this version and those toolbox in my machine
ver
----------------------------------------------------------------------------------------------------
MATLAB Version: (R2015b)
Operating System: Linux
----------------------------------------------------------------------------------------------------
MATLAB Version 8.6 (R2015b)
Image Processing Toolbox Version 9.3 (R2015b)
Neural Network Toolbox Version 8.4 (R2015b)
Optimization Toolbox Version 7.3 (R2015b)
Parallel Computing Toolbox Version 6.7 (R2015b)
Statistics and Machine Learning Toolbox Version 10.1 (R2015b)
Any help please
By the way I checked preference and make set the path to default but same problem,

2 个评论

Please show your code and the complete error message
I am trying to implement convolution neural network in this link http://uk.mathworks.com/help/nnet/convolutional-neural-networks.html and I recieved this error
imageDatastore undefine
Undefined function or variable 'rootFolder'.

请先登录,再进行评论。

回答(1 个)

The code has the line
rootFolder = fullfile(outputFolder, '101_ObjectCategories');
above the point where it uses rootFolder, so you must have missed some lines in your implementation.

4 个评论

Mnay thanks for replying, I have tried many times but same error this is the code which I copied it.
% Download the compressed data set from the following location
url = 'http://www.vision.caltech.edu/Image_Datasets/Caltech101 /101_ObjectCategories.tar.gz';
% Store the output in a temporary folder
outputFolder = fullfile(tempdir, 'caltech101'); % define output folder
>>
>>
>> if ~exist(outputFolder, 'dir') % download only once
disp('Downloading 126MB Caltech101 data set...');
untar(url, outputFolder);
end
>>
>>
>> rootFolder = fullfile(outputFolder, '101_ObjectCategories');
categories = {'airplanes', 'ferry', 'laptop'};
>> imds = imageDatastore(fullfile(rootFolder, categories), 'LabelSource', 'foldernames');
Undefined function or variable 'imageDatastore'.
>>
The function imageDatastore appears to be new as of R2016a, which is confusing because ImageDatastore objects are documented as existing from R2015b, but were at that time only accessible by using datastore()
OK, what I can do as I have R2015b and I bought it only in this January.
If you bought R2015b within the last calendar year, then if you bought anything other than the cheapest version of the Student Version license, then included in that should have been one year of Software Maintenance Service (SMS). That would entitle you to upgrade to all MATLAB versions released within one year. As R2016a was released well within that year, you should be able to go to https://www.mathworks.com/downloads/select_release?mode=gwylf and download R2016a.
Note: the "unbundled" Student Version license, the very least expensive student license, might possibly not include this service.

请先登录,再进行评论。

类别

帮助中心File Exchange 中查找有关 Deep Learning Toolbox 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by