MATLAB provides toolboxes (Matlab Coder, Matlab compiler, Simulink Coder) to generate C and C++ source codes for built in function. I am wondering if there is any toolbox or feature to generate java source code ( not encrypted JAR / class files) for the matlab code/built in functions?
You can use any MATLAB file in the project to generate sample Java driver files. Although Java driver files are not necessary to create a package, you can use them to implement a Java application, as shown in Compile and Run MATLAB Generated Java Application.
Simulink® Coder™ generates standalone C and C++ code from Simulink models for deployment in a wide variety of applications. For a list of DSP System Toolbox™ features supported by Simulink Coder, see Blocks Supported for C Code Generation.
MATLAB Coder can generate C++ code in a namespace, making it easy to integrate with other source code that might have identical function or data type names. The code generator packages all generated functions and type definitions into the namespace.
There is nothing that will convert MATLAB source code into Java source code. The add-on product MATLAB Builder JA will archive and encrypt your MATLAB source code, and create a standalone .jar file wrapper that enables you to call the MATLAB code from Java, but it doesn't produce Java source code.
Note that MATLAB Coder and Simulink Coder produce C, not C++ code, and that MATLAB Compiler works in a similar way to Builder JA, archiving and encrypting your MATLAB code and producing an executable wrapper.
Edit: since release R2015b, functionality to produce .jar files has been moved from MATLAB Builder JA to the new product MATLAB Compiler SDK, which will also produce .dll files and .NET assemblies. MATLAB Builder JA no longer exists as a product.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With