Is this a programming language?

Is this a programming language?

No. But you can write scripts in Matlab.

Dunno but it saved my ass once.
Needed to do evolutionary something something with 35000 - 100 000 iterations and put them into graph.
Needles to say, all my classmates did it in C, then to txt and then to excel while I went straight to graph with matlab.
KEK.

i bet the C method went faster though
Matlab is slow as shit, your better off using R

Yes
But it is a very strong weapon and only great on good hand.
Implying I would waste 2 for loop for just 1 matrix lol

Scripting language

Markup language

>wew C's fast
matlab is for code retarded engineers who need to do other things after the specific calculation is done,
people like that don't need "fast" calculations to circlejerk about,
they need to spend minimal time learning how to do them and get on with their lives.
All things aside if you know C or C++ or even python you are probably better of with them, but with matlab you literally don't have to know anything more than basic syntax and math.
Also Octave is cool and lets you start the work faster if you dont need simulink, and is free

Yes, MATLAB is both a piece of shit program and a piece of shit language.

MATLAB is basically an ancient C-like language without all the good parts.

Look at this code to plot multiple graphs in one image:

figure % this declares the image context you are using, Makes sense RIGHT?
subplot(2,2,1) % this tells it to plot in a subplot when plot is called
plot(x,y1) % this plots the line following the previous 2 instructions
title('Subplot 1') % give a title to the subplot (or the plot?)

subplot(2,2,2) % this overwrites the previews subplot call
scatter(x,y2)
title('Subplot 2')

subplot(2,2,3)
stem(x,y1)
title('Subplot 3')

subplot(2,2,4) %
yyaxis left % plot against left y-axis

plot(x,y1)
yyaxis right % plot against right y-axis
plot(x,y2)
title('Subplot 4')


Notice that:

If you change the order of the plot calls the code stops working.
You have no control on the namespace.
You are forced to use imperative programming.

And this is a fucking "PLOTTING" example, imagine the clusterfuck that form when you do actual complicated stuff. Imagine if you need to deal with async stuff to run MATLAB code in a computer cluster.

>If you change the order of the plot calls the code stops working.
it actually
>werks on my machine

More like a scripting language. Think of it as the most complex calculator on earth. I use it very regulaly for my studies (image processing, lots of number crunching and occasionally solving some abnoxious equations using iterations)

Now do that with any other programming language.

Yopu can do that with opengl just fine.
Just either write the routines for plots or get a library.
>inb4 hurrr durr I have nu time

not him, but i have no time to learn that when i can already do it in matlab and can shitpost in the meantime.
>Just either write the routines for plots or get a library.
the same reason i dont care to learn LaTeX if i can write shit in LO or Word with a properly styled document template (which i can reproduce in 5-10 minutes if i remove it)

>People still compares Matlab to other high level programming languages
Do you guys even realize that Matlab was meant to do complex mathematical operations easy, specifically matrices operations (MATrices LABoratory). The whole point of it was, and is, to provide an easy solution to real life mathematical and engineering problems. Try to do the same complex operations with matrices in other language, you simply can't. Also, try to understand that the people who uses Matlab are mostly mathematicians and/or engineers outside the computer science field.

After that, comes Simulink, it provides an easy solution and a powerful tool to simulate systems (mechanical, electronics, etc). Which is actually the most valuable tool that Matlab has. You simply can't try to do something like that in any other program.

Also, stop comparing apples with oranges, you faggots are missing the whole point of Matlab.

Also, if you really need performance you can port the business logic from matlab to c. It won't give you any real-time performance but it can make a difference between days and hours.

There are actually better ways to do it in matlab. I took a course which was pretty matlab intensive so I automated a lot of things with it. I would calculate coefficients to pass to a simulink simulation, run it automatically, create the images, save them with specific names, etc. Script was pretty much handss-off.
Most of what you wrote could be wrapped in a loop and handled safely with handles instead of trusting the "last active graph" thing.
That's how beginners are taught and it's okay.

>i bet the C method went faster
depends, matlab has highly optimised routines
writing them in C won't be as fast as matlab ones unless you spend a lot of time optimising them, given than you have the know-how

i output the data as text files from C, then parse and graph it in python with matplotlib
easy as py

MATLAB is kind of like Windows, or Office:
- It's a lot of different things to a lot of different people.
- It's pretty good at backwards compatibility / stable APIs.
- It's a good-enough, fast-enough 'get shit done' environment at the intersection of math, programming and engineering.

That said, it's faster and more straightforward to do programming-heavy stuff in something like C++. I.e. if you want to use threads, network sockets, parse text, create complex data structures, etc. - you can do it all in MATLAB, but it'll feel like a mix of C and BASIC, and you'll be fighting the environment a bit.

MATLAB is perhaps better compared to Fortran. It has a sort-of similar syntax, except that Fortran is strongly typed and MATLAB is not.

I worked with a guy who did most of his engineering tasks (metal fatigue analysis) in a set of custom C programs he had developed himself. A brilliant engineer, but I'd estimate that he spent 50% longer on equivalent tasks compared to the rest of us in the office using MATLAB.

YMMV.

> If you change the order of the plot calls the code stops working.

How about you learn about handles and don't do it the 101 way so that this doesn't apply anymore?

Not the same, but a much more clean way in Python:
import matplotlib.pyplot as plt

# Two subplots, unpack the axes array immediately
f, (ax1, ax2) = plt.subplots(1, 2, sharey=True)
ax1.plot(x, y)
ax1.set_title('Sharing Y axis')
ax2.scatter(x, y)


These are the only correct posts in this thread

Is this a programming language?

This. You can edit graphic representations, have access to advanced calculus methods and you even have simulink for system editing and control theory.

Sure you can reproduce all those things using another high level language but holy shit! Your time spent working would fucking double.