How to find what toolboxes (not installed) are necessaries to execute a matlab script?
Clash Royale CLAN TAG#URR8PPP
How to find what toolboxes (not installed) are necessaries to execute a matlab script?
Hi I saw this command that should allow to find toolboxes dependencies:
matlab.codetools.requiredFilesAndProducts
matlab.codetools.requiredFilesAndProducts
however such command will also list the installed toolboxes, which is not what I want.
Is there a way to find out what are the toolboxes that are not installed but needed to execute a given script?
From the documtation
[fList, pList] = matlab.codetools.requiredFilesAndProducts(files)
also returns a list of the MathWorks® products possibly required to run the program files specified by files.
[fList, pList] = matlab.codetools.requiredFilesAndProducts(files)
If you use the matlab.codetools.requiredFilesAndProducts function on
MATLAB code that you received, plist only includes the required
toolboxes that are installed on your system. In this case, plist can
be incomplete.
So the command will list the "required" but that are "installed".
@Wolfie please read the update...
– user8469759
Aug 8 at 14:04
@Wolfie, actually the phrase "not installed" was in the title, but anyway...
– user8469759
Aug 8 at 14:10
1 Answer
1
I can not test it because I have all toolboxes available, but something of the likes:
[files,plist]= matlab.codetools.requiredFilesAndProducts('myfile');
toolboxRequiredAndMissing(plist);
function toolboxRequiredAndMissing(plist)
v=ver;
for ii=2:length(plist)
found=false;
for jj=1:length(v)
found= strcmp(plist(ii).Name,v(jj).Name);
if found
break
end
end
if (~found)
disp(['Toolbox required and missing: ' plist(ii).Name]);
end
end
end
This does not consider versions.
Lemme give it a try.
– user8469759
Aug 8 at 14:04
Not 100% sure it's working, it is listing as missing dependencies
MATLAB Distributed Computing Server
, but when I run the code I have the error regards a Curve Fitting
toolbox.– user8469759
Aug 8 at 14:08
MATLAB Distributed Computing Server
Curve Fitting
You might want to remove the rows in
plist
where plist.Certain == 0
.– Wolfie
Aug 8 at 14:10
plist
plist.Certain == 0
@Wolfie just "may", as as far as I understand, they may still be required, even if MATLAB is not certain
– Ander Biguri
Aug 8 at 14:11
@user8469759 It works for me. If I delete specific
v
toolbox info, this code outputs those as needed. What "is it listing"? What error do you get? All this is new info– Ander Biguri
Aug 8 at 14:13
v
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.
@Wolfie but lists existing toolboxes, I assume OP wants uniquely the non-installed ones.
– Ander Biguri
Aug 8 at 13:52