Matlab has a different purpose, it's primarily used for work in the fields of mathematics, statistics, and numerical computing fields like machine learning and artificial intelligence where stats/maths play a key role. It also provides an REPL for playing around if you want to just play around without using files at the beginning.
Matlab is designed to be easier to learn and use as it does things for you like memory management and it provides a really easy way to do all kinds of graphs and visualizations.
The way it is designed makes it arguably slower than code code written in C, however most people can by with just using Matlab rather than having to write it the more difficult language. It is also not uncommon to write in Matlab first since it is easier and then convert to something else faster once the solution is working if it is not running fast enough.