Trying AI coding with Claude Code: Matlab to C++, all the way to a GUI result
How I used Claude Code to convert Matlab code to C++ and even show the graphs in a GUI.
한국어English
ON THIS PAGE
This post explains how to change a program from one programming language to another with Claude Code.
Matlab, a specialist engineering program, makes plotting graphs (Plot) and processing data easy. But it is paid software and heavy, which makes it inconvenient to use. Because of the nature of the language, it also computes more slowly than C or C++. Still, it is convenient, so it is widely used in engineering.
First, here are the Matlab code and its results.

The content of the code does not matter. It is hard to follow unless you studied the field.


I captured a few screens. You can see that the final graph comes out as Figure 1, with Time domain and Spectrum domain results.
Being able to make result graphs and functions such as FFT simply is the strength of coding in Matlab.
Next, I turn this result into C++ with Claude Code.
For installing Claude Code and setting up your local computer, see the post below.
Installing and setting up Claude Code for the first time in 2026 (Claude Code)
Start Visual Studio Code. Then run claude in PowerShell and you see a screen like the one below. For reference, my Claude Code subscription is Pro.

Give the instruction in plain language, as below. I asked it to find the Matlab .m file and convert it to C++.

It found files, but there seemed to be several, so it asked again which .m file to convert. Type the .m file you want.

It says it has analyzed the Matlab code and is now starting the conversion to C++.

It starts writing the code on its own. If you know C++ well you can convert it yourself, but once advanced functions such as FFT and iFFT are involved, it is hard to code alone. Above all, it takes a great deal of time, and that leads straight to higher cost.

It is doing all of the coding above by itself.

It also summarizes the results of the fft functions in Matlab and C++.

When an error comes up while running, it analyzes it on its own and keeps coding. All you need to do is confirm a few times (pressing the number 1 and so on).

Claude Code is really smart. It keeps the coding going on its own.

It saved the results to a csv file, but I did not stop there and asked it to draw the graphs in a GUI as well. I did not know whether it would work right away, but I was curious how far Claude Code could go, so I asked.

A few errors came up, but in the end it drew the result graphs in a GUI by itself.

These are the final result graphs. The whole process above took less than 20 minutes. Anyone who has done coding knows. The work above would take at least several days, and it is hard to believe we now live in a world where AI agents are this capable. Below is a video capturing the whole process. It is played in fast forward.
Converting Matlab to C++ with Claude Code
I paid for Pro, but I use it so much that I keep running out of tokens, so I am thinking about whether to switch to Max.
This post only covered coding, but I think there will be a lot more to apply it to from here.
There seems to be a lot you can do with Claude Code. I will post about a range of topics.





