In this post, I'll describe how to operationalize MATLAB. By "operationalize" I mean taking MATLAB used for its modeling, analytics, statistics or application development capabilities and making it available to a targeted set of users (internal or external).
First let's consider the big picture. There are many ways to tackle operationalization but not all approaches are suitable for all applications. Everything that you read here is documented but across different product documentation sets. With this post, I've gathered what you'll need to consider.
The power of your MATLAB implementation can be leveraged across a variety of platforms and here, I'll attempt to lay out the available options which range from simple push-button methods to more involved/powerful strategies.
Our first use-case is aimed at developers who are building analytics and models for MATLAB users. Here our target audience is users who sit in front of a MATLAB session.
Packaged MATLAB Apps and Toolboxes
MATLAB apps are self-contained MATLAB programs with UI front-ends that automate a task or calculation. These apps can be created with the App Designer (an environment for building apps), GUIDE (GUI development environment) or, for greater control over design and development, programmatically in MATLAB code.
The apps are then packaged into a .mlappinstall standalone file for easy distribution to our target MATLAB users. Double clicking the file will install the application and make MATLAB functionality available.
Similarly, an entire toolbox of functionality can be packaged into a MATLAB toolbox (.mltlbx) using the Add-ons functionality in MATLAB.
Once packaged, the MATLAB app or toolbox can be versioned and managed like any other file. Users can employ a variety of tools to suit their needs. I know of users accomplishing this with something as simple as a shared folder or as complex as complete ecosystems of enterprise apps managed via SharePoint, Git, etc.
MATLAB Engine based approaches If your target user is using C/C++, Fortran, Java or Python and would like to leverage the power of MATLAB analytics in their application, then the MATLAB Engine API is one potential approach. This allows their programs to connect to a MATLAB session via the engine API and invoke their MATLAB analytics.
This is a peer-to-peer connection and the user's environment will need to reconcile the ramifications of such an interface. It is useful in automation of tasks and in applications where MATLAB is an equally privileged, equipotent participant in the application.
MATLAB Runtime powered approaches The MATLAB Runtime is a standalone set of shared libraries that enables the execution of compiled MATLAB applications or components on computers that do not have MATLAB installed.
The Application Deployment products leverage the MATLAB Runtime to allow MATLAB developers to share their work royalty-free with people who don't have access to MATLAB.
In this space, the solutions range from standalone desktop applications and Microsoft Excel add-ins to full integration with enterprise IT systems.
The waters run a bit deep here - so, to further break down the use-cases for this, it makes sense to approach the possibilities from the perspective of whether the target user would like to decentralize the application with the MATLAB Runtime and application installed per user or centralize the analytics using a client-server approach.
For decentralized approaches, MATLAB can be made available as standalone application or a Microsoft Excel add-in using the MATLAB Compiler. For custom applications in C/C++, .NET, Java and Python, the MATLAB Compiler SDK provides platform specific shared libraries, Microsoft .NET assemblies, Java classes and Python Packages from MATLAB programs.
For a centralized approach, the MATLAB Compiler SDK provides the flexibility to develop your own custom infrastructure or take advantage of MATLAB Production Server for secure, scalable web and enterprise applications.
To aid in these integrations, the MATLAB Production Server supplies lightweight client libraries for C/C++, .NET, Java and Python as well as simple clientless RESTful JSON-powered interfaces - providing a full product stack with capabilities for synchronous and asynchronous execution of MATLAB code like we discussed on this blog earlier.
MATLAB Coder based approaches There are several environments where a full MATLAB session as well as the MATLAB runtime environment is not suitable. These platforms (such as 32-bit environments) are often at the core of data appliances and embedded environments. Fortunately, MATLAB Coder furnishes workflows to generate standalone readable and portable C and C++ code from your MATLAB code.
This brings me to my favorite trick question: on a typical day, when do you first use operationalized MATLAB?
Most people answer that it would be after getting their coffee and clicking on the familiar membrane at work. In reality operationalized MATLAB is probably at work as you insert the key into your car for your drive to the office or earlier when you pick up your electric toothbrush or when you wake up, turn on the lightswitch and light up your day.
MathWorks tools allow you to combine these different use cases, described here, to meet your particular needs. If required, these products can be coupled with Training and Consulting services to help with the implementation of solutions to your engineering problems.
I've tried to condense this information and survey it from the viewpoint of a developer (i.e. you, the reader). In doing so, I arrived at the following treasure map / cheat sheet / infographic / decision tree of possible routes. While neither perfect nor complete - I wanted to share the perspective.
What do you think of it? Please use the comments and let me know.
Were you curious about how it fits here?
Please do indicate interest in the comments since those are completely different topics that I have been considering blogging about in the future.
To leave a comment, please click here to sign in to your MathWorks Account or create a new one.