The Community tab of the MathWorks website now offers the new AI Chat Playground. This allows you to transfer programming tasks to an AI – and try them out directly.
At the beginning of my MATLAB-based courses, I first briefly introduce the MathWorks website, which provides all the necessary resources for MATLAB users that users of other programming languages have to compile themselves. The Community Tab of the MathWorks Website includes the MATLAB Answers, the File Exchange, the Blogs from longtime MathWorks engineers and department heads, and Discussions. When I was putting together the presentation for the next course, I came across something new: the AI Chat Playground. Meanwhile, MathWorks is announcing it everywhere, today in their email newsletter.
This is great, as colleagues and students had just started to feed ChatGPT with MATLAB tasks in order to get back more or less well working solutions. As we know, ChatGPT gets these solutions from publicly available (untested) sources like Stackoverflow, but probably also from the MathWorks website. I myself tried to have some MATLAB coded programmed by ChatGPT and did not get a working result. I copied/pasted the code into the MATLAB editor and got as many error messages as lines of code. Of course you can ask ChatGPT to rework it – but it didn’t get any better. You all know the examples from the net where the AI algorithm ChatGPT stubbornly marches in the wrong direction and can hardly be dissuaded from delivering incorrect results. The chat bot always apologizes politely, only to deliver something wrong again.
Of course, there is a warning on the website, as with any AI, that the code may look useful, but it is not. However, this can be checked quickly here, because you can run the code right in the AI Chat Playground to test it – and of course the solution is always written in MATLAB. I’ve tried it out with a few simple examples that worked well. It’s those simple things that you need all the time, like in the example in the screenshot above, or a graphic in a specific design, such as “Please write the MATLAB code for a graph with a line of thickness 2, RGB color [0.8 0.5 0.3] and a square marker.”, and you get:
x = 1:10; y = rand(1, 10); plot(x, y, ... 'LineWidth', 2, ... 'Color', [0.8 0.5 0.3], ... 'Marker', 's');
which works fine. This helps a lot to quickly find solutions for standard tasks – and I will now have to see how I deal with such solutions in the students’ homework! But this is a general problem not only in courses on data analysis with MATLAB.