Why do I get an 'Undefined variable "com" or class' error when running a toolbox from File Exchange?

9 vues (au cours des 30 derniers jours)
I have downloaded a zip file from File Exchange, extracted the directory, and opened the directory from MATLAB. I run the toolbox command and encounter the following error:
"Undefined variable "com" or class "com.xxx.xxx". 

Réponse acceptée

MathWorks Support Team
MathWorks Support Team le 21 Oct 2021
Modifié(e) : MathWorks Support Team le 21 Oct 2021
The error is encountered when a java dependency is not detected in the Java class path. This may happen when the toolbox is not fully added to MATLAB.
To add a zipped File Exchange toolbox to MATLAB, the general process is as follows:
1. Extract the ZIP file
2. From the "Current Folder" window in MATLAB, right-click on the extracted folder and select "Add to Path", then "Selected Folders and Subfolders"
Certain toolboxes may contain additional JAR files that need to be added to the JAVACLASSPATH for the toolbox to run correctly.
You can add the JAR files to the dynamic class path using the 'javaaddpath' command.
To automatically load the JAR files every time MATLAB starts, you can add the jar files to the static class path from the 'javaclasspath.txt' file. You can find more information on how to do so in the following link:

Plus de réponses (0)

Catégories

En savoir plus sur Use COM Objects in MATLAB dans Help Center et File Exchange

Produits


Version

R2017a

Community Treasure Hunt

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

Start Hunting!

Translated by