MATLAB: How to convert a .m script to .sbproj file

.sbprojMATLABMATLAB and Simulink Student SuitemodelingSimBiologysimbiology command line

I have both Simbiology and MATLAB installed on my machine. I have implemented a SimBiology model using MATLAB code, which is saved as a .m file. I would like to save or convert this model to a .sbproj file. Is there a way to achieve this?
I am trying to do this because we simulate our model using a MATLAB script. This script defines all of the modeling parameters, including an SSA solver and triggering events. Our previous model was implemented using the SimBiology Graphical User Interface. We have made a similar model using SimBiology Command Line. The model we created is somewhat similar to what is shown here: https://www.mathworks.com/help/simbio/gs/-model-a-gene-regulation-pathway.html. We want to simulate the new model that was created from the SimBiology Command Line using our simulation script. However, this requires the SimBiology model to be saved in .sbproj format. Any ideas on how this could be achieved would be much appreciated.
Thank you!

Best Answer

Hi Colton,
You can use the sbiosaveproject function to save the SimBiology model (and data) to a .sbproj file. For example,
model = sbmlimport ('oscillator.xml');
simData = sbiosimulate(model);
sbiosaveproject oscillator.sbproj model simData;
Hope it helps, Joe