Clear Filters
Clear Filters

imageDatastore error in Matlab online usage

2 views (last 30 days)
Hello!
I'm trying to use the imageDatastore as the documentation indicates:
imds = imageDatastore(fullfile(matlabroot,"toolbox","matlab"),...
"IncludeSubfolders",true,"FileExtensions",".tif","LabelSource","foldernames")
However, the following error occurs when I'm using Matlab online:
Error using imageDatastore
The first input to exist must be a string scalar or character vector.
Also, when I click over the hyperlink to the documentation, an error pop-up appears while in the command console the following is printed:
Error using split
First argument must be text.
Error in matlab.internal.doc.url.DocContentPage/splitPath (line 139)
pathParts = split(pathParts,"/"|"\")';
Error in matlab.internal.doc.url.DocContentPage/buildUrl (line 111)
helpLocation = matlab.internal.doc.url.DocContentPage.splitPath(obj.Product.HelpLocation);
Error in matlab.internal.doc.url.DocPage/getNavigationUrl (line 33)
url = obj.buildUrl;
Error in matlab.internal.doc.ui.DocPageLauncher/openDocPage (line 30)
success = openBrowser(obj.Handler, getNavigationUrl(activePage));
Error in doc (line 79)
launcher.openDocPage;
Error in helpPopup (line 18)
doc(topic);
Error in matlab.internal.language.introspective.errorDocCallback>popTopicHelp (line 67)
helpPopup(topic);
Error in matlab.internal.language.introspective.errorDocCallback (line 33)
if popTopicHelp(fileNameQualifiedTopic)
------------------------------
Can anyone help me?
Thanks in advance.

Answers (1)

Suvansh Arora
Suvansh Arora on 7 Nov 2022
One of the possible workarounds is to provide the MATLAB toolbox path manually as a string, rather than passing it on through the “fullfile” function.
imds = imageDatastore("/MATLAB/toolbox/matlab","IncludeSubfolders",true,"FileExtensions",".tif","LabelSource","foldernames")
In order to DEBUG this further, please follow the below mentioned procedure:
  1. Make sure MATLAB online can process other normal commands.
  2. On your offline machine, you can also try to locate the path of “.tif “ files mentioned in the documentation: Datastore for image data - MATLAB
I hope the above information helps you.

Categories

Find more on File Operations in Help Center and File Exchange

Products


Release

R2022b

Community Treasure Hunt

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

Start Hunting!