android调用matlab中的函数方法

How to integrate Matlab code library with Android?


由于课题要求,需要在android平台实现比较复杂的画图,用Achartengine研究了也难以达到,于是便想借用matlab中的函数方法。经网上查找资料后,有如下方法:


If you have an additional product, MATLAB Builder JA for Java, you can produce a .jar file from your MATLAB code.

However, the .jar file requires the MATLAB Compiler Runtime (a freely redistributable component that you get with MATLAB Compiler and MATLAB Builder products) to be present. The MCR has a much larger footprint than is suitable for the typical Android device (it's like a copy of MATLAB itself, without the user interface).

You could think about either

  1. Running your MATLAB .jar file remotely on a server, and having your Android application connect to it, or
  2. Instead of using MATLAB Compiler and Builder products, use MATLAB Coder, which will convert a subset of the MATLAB language directly into C code. This C code doesn't require the MCR, and could be compiled to run directly on Android. Make sure your MATLAB algorithm falls within, or can be expressed in, the appropriate subset of the MATLAB language.
  也就是说;
        按第一种方法就是生成.jar文件,供调用。此方法最基本的配置环境是要matlab版本所支持的JDK要与所安装的Jdk阪本一致;
        第二种方法:是将MATLAB的文件转换为c/c++,再来通过接口调用。


你可能感兴趣的:(android)