App to convert Simbiology models to .sbproj files
1 次查看(过去 30 天)
显示 更早的评论
Hi, I frequently need to convert Simbiology models to .sbproj files using simple script with 'sbiosaveproject' function. I am inerested to build .exe out of this script using Matlab Compiler. However I am not sure if sbiosaveproject is supported by the Compiler. https://www.mathworks.com/products/compiler/supported/compiler_support.html Is there a way to do it?
0 个评论
采纳的回答
Arthur Goldsipe
2017-11-22
Hi Ivan,
The key questions are (1) why do you want to create an EXE app, and (2) what do you really need to accomplish with the app?
If your goal is to create .sbproj files without a full license and installation of MATLAB and SimBiology, that is not currently possible due to licensing restrictions. The compiler support page lists the restrictions on apps created with MATLAB Compiler. For SimBiology apps, we do not support .sbproj files or the models stored in such files. Instead, you must use SimBiology.export.Model objects or SimFunction objects, which must be saved in .mat files. Both of these provide the ability to simulate a model. However, you cannot build new models or change the structure of such models. (What I mean by that is you can't add or remove things like species or reactions in an app.)
If your goal is to use SimBiology functionality in an environment that does not require a license of MATLAB or SimBiology, you must write an app that uses SimBiology.export.Model objects or SimFunction objects. Here's an example .
If you goal is to automate the creation of sbproj files, you have several options for doing that, but all the options would require full license and installation of both MATLAB and SimBiology. Then, you could create an app using the App Designer. You could also create an .exe that communicates with the installation of MATLAB to run your script that create .sbproj files. You can see a list of APIs for various languages in the documentation for MATLAB Engine Applications.
Does that clear things up?
0 个评论
更多回答(5 个)
Sietse Braakman
2017-11-17
Hi Ivan,
I am not sure I fully understand your situation. If your SimBiology models are not already an .sbproj, what format are the models in before you save them to .sbproj? With the .exe, is your aim to open a model and save it to .sbproj?
Kind regards,
Sietse
0 个评论
Sietse Braakman
2017-11-17
编辑:Sietse Braakman
2017-11-17
Hi Ivan,
Here are my thoughts:
- If your models are "SimBiology.Model"-objects (you can hoover over the model in your workspace to confirm), you can do the following:
- Create an app (if you are on MATLAB 2017b, I would recommend using the App designer, rather than GUIDE). In the app:
- Create a button to load the script (uigetfile),
- once loaded, evaluate the script (eval),
- create a text input box to define the file name you want to use for the project,
- create another button that, when clicked, runs code to save the model (sbiosaveproject with the file name defined in step 4).
- compile the app to give you a .exe
- If your models are MATLAB models (i.e. sets of ODEs in MATLAB, rather than a SimBiology.Model object), you could write a script that parses out your ODEs to create a SimBiology model. For instance, you could generate a species for each state in your model and assign a rate rule to each species that is defined by the right-hand side of your ODE. Once you have created this SimBiology model, you'll have a SimBiology.Model object, which you can proceed with as above.
I hope that helps. Kind regards,
Sietse
0 个评论
社区
更多回答在 SimBiology Community
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Perform Sensitivity Analysis 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!