Info

This question is closed. Reopen it to edit or answer.

Instrfindall gives an error in a Matlab executable (and not in Matlab)

1 view (last 30 days)
Dear all,
I built a Matlab executable to read-out an Arduino. To this end I use instrfindall to make a list of all COM ports and then Matlab finds the correct Arduino by communicating with them (one COM-port at the time). This works well when the program is directly built from Matlab (by pressing F5).
But after compiling it to an executable it produces an error on the instrfindall querry:
Instruments = instrfindall();
The Windows command prompt says that there is an error on the line of the querry, but no reason specified.
I tried running the executable as an administrator but that doesn't make a difference. Anybode an idea how to solve this?

Answers (2)

Vinod
Vinod on 12 Jul 2015
Please contact technical support with the reproduction code.

Kevin Hajek
Kevin Hajek on 31 Jul 2015
I contacted support for something similar and found something that may be useful for you to try. I was getting the following error message:
Undefined variable "com" or class "com.mathworks.toolbox.instrument.Instrument.jinstrfindall"
==================================
Hello Kevin,
I am writing in reference to your Technical Support Case #01454153 regarding 'Trouble with 'instrfind' when deploying a compiled applican'.
Thank you for contacting Technical Support at MathWorks, I understand that you are not able to execute a standalone version of your application that works as expected in MATLAB.
This is a known issue with MATLAB Compiler in R2015a and is reported externally at the following web page:
There is a bug in MATLAB Compiler because of which 'instrument.jar' is missing from the Java classpath in the MCR. Please follow the steps mentioned in the bug report to resolve the issue.
...<other non-essential text>...

Community Treasure Hunt

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

Start Hunting!