How to call a SimBiology function from Java

Hi All,
I'm using MATLAB SimBiology to run a cancer cell signalling network simulation, and want to pass the results of the simulation to Java for more interesting visualisations. The network is defined in an SBML file, so in my MATLAB code I have the following:
function sivit = sivitLoadSBMLModel( fname )
sivit.m = sbmlimport(fname);
% ... and then about 50 more lines of doing stuff to sivit.m
This works OK in MATLAB, but when I build sivitLoadSBMLModel into a Java class and call it from Java, I get the following error:
Undefined function or method 'sbmlimport' for input arguments of type 'char'.
So - how do I connect between SimBiology and Builder JA?
Thanks a lot - Mark

 Risposta accettata

Arthur Goldsipe
Arthur Goldsipe il 11 Lug 2012
I'm one of the developers on the SimBiology team. The error you are seeing is typical of what happens when a function isn't available in the deployed application, either because of licensing restrictions or because of a problem with the deployment process.
In your case, sbmlimport is a SimBiology function, and up through release R2012a SimBiology was not licensed for deployment. For R2012b (which is currently available in pre-release -- see http://www.mathworks.com/support/solutions/en/data/1-5NTATZ/index.html?solution=1-5NTATZ), I worked on adding support for SimBiology in a deployed environment. I only specifically tested the creation of executables using the MATLAB Compiler, but I believe you will now also be able to deploy Java classes using MATLAB Builder JA.
However, due to licensing restrictions, applications using SimBiology must be deployed using a special "export" model, which means you must decide which models you want in your application and specifically export them for use in the deployed application. So you will need to use sbmlimport outside of the function you wish to deploy. Instead, you will need to load the "export" version of the model from a MAT file. For more details, I recommend you download the pre-release and look at the new example in the documentation that shows how to deploy a graphical application that simulates a SimBiology model (just search the documentation for the example titled "Deploy a SimBiology Model").
-Arthur

1 Commento

Thank you Arthur,
It's a bit of a pity since, essentially, I cannot do what I'd like to - i.e. have an interface that loads an arbitrary sbml file - but at least I can now stop trying to make it work :)
Bests - Mark

Accedi per commentare.

Più risposte (0)

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by