# Automatically build MATLAB apps

Posted by Jiro Doke,

Jiro's pick this week is App Builder for SimBiology Models by my colleague Asawari Samant.

MATLAB is a scientific software for solving engineering and scientific problems. You can interactively explore your data and apply sophisticated analysis routines to get insights and draw conclusions. Sometimes, you may want to provide those analytical capabilities to other people you work with, but they may not be as familiar with MATLAB as you are. Or, they may not be interested in freely exploring their data, but they would like to be able to apply the specific analysis routines you developed for the problem. In such cases, it's often useful to provide them with a nice user interface around the functionality you built.

With MATLAB, you can create user interfaces for your program.

But what's different about this app from other MATLAB apps? Well, this was "automatically" created based on a number of parameters.

This entry by Asawari is specifically for users doing PK/PD and systems biology modeling using SimBiology, but a similar framework can be applied to other applications. The basic idea is to create a structure of parameters that defines the SimBiology model that it's connected to, the input parameters that you would like your app to be able to control, the output parameters you want to monitor, and any other parameters that are relevant for the app.

% Project and model information
xin.projectName = 'Tumor_Growth';       % project name
xin.modelName = 'Monotherapy';          % model name

% Inputs and ranges
xin.inputs  = {% Name, Lower Bound, Upper Bound
'L0'  0    20;
'L1'  0    10;
'w0'  0    10;
'k1'  0    20;
'k2'  0    10;
'ke'  0    10;
'x1'  0    10;
'x2'  0    20;
'ka'  0    100;
'Central'  0    10;};    % sliders ranges

% Specify output
xin.outputNames = {% Name , Scope;
'w', ''};            % Name and Scope

% Specify time & time units
xin.timeUnits = 'day';                  % stop time units
xin.stopTime = 30;                      % stop time

% Specify dose properties
xin.doses = 'IV Dose';                  % doses

% Specify name of image file with model schematic
xin.imageFilename = 'tumorModel.png';   % model schematic

% Specify name of the app
xin.appName = 'Model Exploration: Tumor Growth';


Once those parameters are set, you simply call buildApp to create the app.

buildApp(xin, 0)


This framework works really well for this application, because the task of varying parameters and simulating the model is a very common use case in PK/PD modeling. Well, it's common for any kind of modeling for that matter. However, creating a custom app for different models, with different number of parameters, can be a tedious task. Asawari's entry makes this an automated process.

In the entry, Asawari includes several examples that show how one can use the app builder. Note that you need SimBiology and Statistics Toolbox to run this. If you want to create standalone apps, you also need MATLAB Compiler.