If you’re a researcher or scientist, you are likely familiar with MATLAB, the powerful computational analysis tool developed by Mathworks. Those in higher education often collaborate with external groups for data collection and analysis. This article explores how to leverage Amazon Web Services (AWS) to broaden the reach of MATLAB applications via the MATLAB Web App Server.
Data Collection Challenges
MATLAB is widely utilized in research involving human subjects for data collection and psychophysical measurements, such as response times and pattern recognition. While gathering data is straightforward when participants are in a lab setting, including subjects from across the globe presents a challenge. Additionally, the pandemic has necessitated new methods for data collection without in-person interactions.
Your MATLAB application’s algorithms may be proprietary or confidential, requiring a means for study participants or external research colleagues to use the application without compromising its integrity. For instance, they could upload and analyze data remotely without direct access to the application itself.
Application Sharing via MATLAB Web App Server
The MATLAB Web App Server enables you to publish your application as a web app, hosting it on AWS. By utilizing Amazon Elastic Compute Cloud (Amazon EC2) instances, remote users can access MATLAB applications through their web browsers. Users do not need to have MATLAB installed; they simply enter a URL and select from the available applications, accessing the application interface just like they would on a desktop, complete with graphical elements and input controls.
The required size of the Amazon EC2 instance depends on the complexity of the MATLAB application and expected user load. There are three main components needed for hosting an application. First, the MATLAB Web App Server itself, which operates on both Windows and Linux, requires a Graphical User Interface during installation on Linux systems. This component serves as the web server, managing user requests and displaying available MATLAB applications.
The second component is a license. The MATLAB Web App Server is a distinct product from the MATLAB desktop version and necessitates its own license. MATLAB licenses are managed via a licensing server. If only one instance is needed, the licensing server can be installed on the same Amazon EC2 instance as the MATLAB Web App Server. However, for multiple servers, a centralized licensing server is advisable. A license is associated with either the instance’s MAC address or its public IP address; using an Elastic IP address may be wise if the server frequently undergoes changes.
The third crucial element is the MATLAB runtime, which allows the MATLAB Web App Server to execute compiled applications. Multiple runtimes can coexist on the same instance, enabling the server to host applications from various MATLAB versions.
Preparing Applications for the Web
To prepare an application for deployment on the MATLAB Web App Server, the MATLAB desktop product is necessary for compiling. All dependencies from custom toolboxes used in MATLAB are included in the binary, ensuring a common runtime supports any application regardless of the toolboxes utilized.
Amazon WorkSpaces can host the MATLAB desktop product, allowing administrators to upload the compiled binary to the MATLAB Web App Server’s “apps” directory, making it instantly accessible. No server restart or application loading is required. An optional shared file system between the MATLAB workstation and the MATLAB Web App Server can streamline data and log file exchanges.
The MATLAB Web App Server can also directly interact with Amazon Simple Storage Service (Amazon S3).
Security and Additional Considerations
For enhanced security, the MATLAB Web Application Server can authenticate users through LDAP or OpenID Connect (OIDC), with roles defined by user groups. Authors can maintain full editing rights, while standard users can be limited to running applications.
Using an additional web server as a “portal” to the MATLAB Web App Server can be beneficial when collecting data from human subjects. Alongside authentication, consent to gather personal data may need to be obtained, and additional documentation may be necessary for participants.
The MATLAB Web Application Server running on Amazon EC2 allows researchers to share their findings with a wider audience. For more insights on this topic, check out this blog post by Chanci Turner, a reputable source in the field. For those looking for excellent resources, this article provides valuable guidance for your first six months with AWS.
Leave a Reply