What We’ve Learned When Migrating MATLAB to C++
MATLAB is a powerful tool for algorithm development, widely used in science and engineering. It’s not always the right fit for production environments, however.
We saw this firsthand during a recent project with Calpro, a Norwegian biotech company specializing in at-home diagnostic tools. Their Proof-of-Concept relied on MATLAB to power a computer vision algorithm that analyzes medical test strips using a smartphone camera. While MATLAB served them well in early development, it quickly became clear that it wouldn’t meet the performance and platform requirements of a commercial mobile app.
To address this, we migrated the algorithm to C++, unlocking major improvements in speed and mobile compatibility.
Read the case study here: Is Your PoC Too Slow? How We Optimized Algorithm Performance for Commercial Development
In this post, we’ll first explore what MATLAB is and where it excels, as well as where it falls short. Then, we’ll share key takeaways from our MATLAB-to-C++ migration and highlight lessons learned from the Calpro case study. Let’s go.
1. What is MATLAB and Is It a Programming Language?
Yes, MATLAB is both a high-level programming language and a powerful computing environment, widely used for numerical computing, data analysis, and algorithm development.
As a programming language, MATLAB is not general-purpose like Python or C++, but it excels when your work is math-heavy. It allows you to write clear and concise code for mathematical operations without having to manage low-level details.
Why Developers Use MATLAB
- Interpreted language – great for rapid iteration and debugging
- Rich ecosystem – includes toolboxes for deep learning, signal processing, computer vision, and more
- Excellent plotting and visualization – ideal for data exploration and presentation
- Integrated development environment (IDE) – includes profiling, visualization, and debugging tools out of the box
2. What is MATLAB Used For?
Originally developed for matrix mathematics (hence the name: MATrix LABoratory), MATLAB is especially popular in engineering, scientific research, and academia.
Its syntax and structure are optimized for working with arrays, making it a go-to tool for domains like:
- Signal and image processing
- Machine learning
- Control systems
- Computer vision
- Scientific simulations and prototyping
When MATLAB Falls Short
While MATLAB is excellent for prototyping and research, it’s not well-suited for production environments where performance, cross-platform support, and scalability are critical.
Some limitations include:
- Slower execution compared to compiled languages like C++
- Limited suitability for mobile or embedded systems
- Requires a commercial license (not open-source)
For this reason, many teams prototype algorithms in MATLAB but later migrate them to languages like C++, Python, or Java for commercial deployment.
Book a 1:1 Computer Vision Consulting Session
3. Key Takeaways from Migrating MATLAB to C++
Takeaway #1
MATLAB Is Great for Prototyping, Not for Mobile Deployment
MATLAB excels in early-stage R&D. It allowed Calpro’s team to rapidly prototype a computer vision algorithm for analyzing calprotectin test strips via smartphone camera. MATLAB’s built-in functions and data visualization tools made it easy to experiment and iterate.
However, as Calpro prepared to move from proof of concept to a production-ready mobile app, MATLAB’s limitations became clear.
- It isn’t optimized for mobile platforms like iOS or Android;
- It lacks native support for mobile hardware integration;
- It introduces performance overhead not suitable for real-time execution
In short, while MATLAB helped get the algorithm off the ground, it couldn’t scale into a commercial-grade mobile solution without major compromises to speed and usability.
Takeaway #2
C++ Migration Delivered Significant Performance Gains
To meet the demands of real-time performance on mobile, we rewrote the algorithm in C++, a compiled language known for its speed and efficiency.
The results were immediate and measurable:
- Execution time dropped significantly, enabling real-time feedback for users;
- Computational load was reduced, which is especially important for mobile devices with limited processing power;
This step was critical not just for performance, but for ensuring a smooth user experience. What was once a lab-friendly prototype became a lightweight, responsive feature inside a production mobile app.

Takeaway #3
Mockup Testing Validated the Migration Decision
Rather than fully commit to the new implementation without testing, we created a mockup app to benchmark the performance of the original MATLAB algorithm against the newly written C++ version.
This approach gave us:
- Hard performance data to compare versions under real-world conditions
- A way to validate integration workflows before touching the full app codebase;
- A clearer picture of how the new algorithm would behave in a mobile runtime environment.
The testing process confirmed what we expected. C++ delivered a major performance boost. By validating this with a mockup, we reduced risk and increased confidence before committing to full-scale implementation.
4. When and How to Migrate from MATLAB
These takeaways underscore a key principle in software development: the tools that support rapid research and prototyping often fall short in real-world production environments.
This was exactly the case for Calpro. While MATLAB enabled fast early progress, it became a bottleneck as the product matured. Migrating their algorithm from MATLAB to C++ was a pivotal move that helped turn an innovative PoC into a scalable, high-performance mobile application.
If you’re developing a product that begins in MATLAB but is destined for mobile, embedded, or production-grade platforms, you should start thinking about when to transition out of MATLAB based on performance and platform constraints, which language or tech stack aligns best with your long-term product goals and how to validate your migration safely and iteratively before full integration.
Get Inspired By Those Projects
5. What Do You Need to Know About DAC.digital?
At DAC.digital, we specialize in helping companies turn innovative ideas into production-ready solutions. We’ve worked with clients like Calpro to successfully bridge the gap between R&D prototypes and commercial-grade software, particularly in performance-critical areas like computer vision. If you’re building a product that relies on visual data, we can support you at every stage of the journey.
Our End-to-End Computer Vision Development Includes:
- Algorithm Design – from feasibility research to tailored model development
- Hardware Selection – choosing and integrating the right sensors, cameras, and embedded devices
- System Architecture – setting up scalable, efficient pipelines for image processing and data flow
- Integration – deploying optimized solutions to devices running on Android, iOS, or custom hardware
- Full Product Development Cycle – from PoC to MVP to commercial launch, with agile, cross-functional teams

If you’re looking to commercialize a computer vision solution, let’s talk. We’ll help you navigate the algorithm optimization, deployment, and optimization, so you can focus on delivering value to your users.
Move Your Computer Vision Project from Your Computer to Real World