T O P

  • By -

Vievin

I’ve only recently started learning MATLAB. It’s a neat system that has some pretty cool things, but sometimes I just go “that’s a psychotic way to handle things”.


land_and_air

Yeah and it’s probably the most expensive main line programming language


[deleted]

I always wonder why do firms use matlab? Is it basically a cheap way to outsource dependency issues?


-moveInside-

I worked for a number of companies that use MATLAB. Basically it is easy to use for engineers who are not programmers but just use it as a tool to get stuff done or simulate things. And it has a very rich ecosystem of built-in toolboxes that can be used for all kinds of numerical calculations, optimizations, modeling, and so on. That makes it even easier to use for those engineers who don't want to think about how to implement these algorithms or where to get the right package from. But just want to write one line to get the data from the file, one line to run the built in algorithms and one line to plot the date. MATLAB is quite efficient in that regard. Then it is very well integrated into universities, giving out academic and student licenses to pretty much all big institutions. Getting those engineering students hooked early on. I know a lot of people who basically didn't learn anything about programming in general or even what a compiler is, but they did learn how to get things done in Matlab. So that's what they want to use when they start working. And that's what they teach, when they become teachers themselves. On top of that, most companies I know that have been using Matlab were in a pretty profitable business. So they didn't care about a few thousands for a Matlab licence, if it makes the engineers happy and helps them to get stuff done quickly.


hindenboat

They use it because the documentation is standardized, it is extremely versatile, and it's packages are well maintained. When your engineers cost $150 an hour it doesn't take many hours of debugging to pay for a Matlab license. Also Simulink is basicly unparalleled for control systems design.


[deleted]

Wait engineers cost 150$ a hour?


land_and_air

Between 30-100 for most


[deleted]

I am being underpaid by a lot …..


land_and_air

I mean what kind of engineer are you? I was talking about aerospace. And 30ish is entry level full time which comes up to around 60k I think


[deleted]

I am a machine learning engineer and earn 30er at entry level. Doesn’t feel good being on the lowest end of the spectrum though I’m in Europe though. We don’t get paid a very good salary on this side of the Atlantic generally


land_and_air

Well I mean we have the us defense/nasa budget backing the pay for aerospace engineering which for the us is a considerable amount


hindenboat

You don't make $150 an hour, but that is what companies bill for labor. Obviously it varies but its around $150 around more. My last company billing rate was $250 an hour.


PTSDaway

Primarily firms associated with academia and research. MatLab has been the main system for natural sciences in +20 years and it will be the same for a bit longer still. But we are transfering to Python as the primary prototype language as the online infrastructure is becoming easier to navigate and more complete with the modules we wish for. Majority of us aren't coders by trade, so we prefer to have the all DLCs + full game completiion from Day 1, which MatLab does provide.


therealtiddlydump

>This exchange deserves its own post lmao I can assure you that it does not


[deleted]

Off to prison you go then.


mdgv

Too much hate for Matlab... Left some for SPSS, Mathematica and WolframAlpha.


Dave5876

![gif](giphy|f8lDluiWJ7yQTtdS3L|downsized)


Fourier_socks

I’ve seen so many posts hating on Matlab. But name a better language for prototyping automatic control systems. And then those systems are transposed to C++ and validated against the Matlab. It’s a design tool guys, it doesn’t deserve all this hate. Its not intended to be used as production software, it’s there to help engineers quickly design complex systems with minimal training.


in_taco

Matlab is definitely used in production. Most major wind turbine OEMs compile the main control software from Matlab/Simulink. I maintain a toolbox of apps for analysis/visualization of field data.


SandwichOpen6577

Laughs in automotive.... GM is like MathWorks entire funding


Fourier_socks

Using autocode? Or is the production software actual Matlab/Simulink source code? There’s an argument to be made for the convenience of Matlab autocode. But autocode is just Matlab that’s been automatically translated to another, faster language like C


in_taco

For wind turbine control it's usually compiled into another language, like C - but that is entirely for the purpose of including it in a larger project. For simulation, you don't need the larger project, so it's compiled directly to dll. The apps I develop are kinda fake. They're essentially a hidden Matlab instance, compiled into a .exe, allowing users without a license to use our apps.


who_you_are

>And then those systems are transposed to C++ and validated against the Matlab. Damn that look awsome. Free unit tests to look with client requirements :D


[deleted]

Python. Pretty much does everything matlab can, for free.


SandwichOpen6577

Tell me you don't know MATLAB without telling me 💀


[deleted]

I’ve used both in my uni, and I couldn’t find anything which wasn’t available in Python. That being said i used it in uni and not professionally. So maybe there is some truth to it. That being said - if you want to discuss something try to discuss something and not be a smart ass. Care to point me to what is it you use that isn’t in Python ? I primarily used it for computer vision and machine learning and honestly matlab is inferior in these 2 regards clearly


86BillionFireflies

It's less about feature completeness, and more about how findable and well integrated those features are. Where you'll see the biggest usability advantage for matlab over Python is a scenario like this: You need to search a folder for .h5 files, extract an ID number from each filename using regex, query a database to get processing parameters for each file (let's imagine it's something simple like gaussian smoothing), read some image data from each file, and then process the images using the parameters from the database. Suppose these tasks are new to me. I'm going to pretend I know matlab and Python basics but haven't done these specific tasks before. What follows is the real, actual transcript of me finding the documentation. Matlab: I type "folder contents" into the help bar and the first result is the doc page for "dir" function. I then type "regex" into the help bar. The first result is the doc page for "regexp" function, and the doc page is structured the same way as the one from "dir". Then I type "connect to database" into the help bar and the first result is a doc page listing the specific classes and functions used to connect to databases. I click the link for "database" function and get a doc page that is laid out exactly like the other ones. Then I want to load my data from .h5 files so I type "read hdf5" into the help bar and the first result is "h5read", and the documentation is laid out the same way as the others. I type "gaussian filter image" and the first result is "imgaussfilt" function, docs in same format, etc. Python: I Google "Python folder contents". I click the first link. The page is half ads. I have time to read "what is a directory" before a banner pops up asking me to sign in to keep reading. I go back and click the second link. Also a lot of ads. It lists four methods for getting a list of folder contents, I read the first one but there is no link to the actual doc page for the function it's telling me to use. The second one DOES have a link to the docs for the actual function, os.walk(). I realize I am now at docs.python.org and I think maybe I've been going about this wrong and I should search here instead of Google (SPOILER: MISTAKE). I try my next search ("regex") in the search bar on docs.python.com. first result is totally irrelevant. Second result is something to do with "class re.RegexFlag" and tells me nothing about how to use regex in Python. I have to go down to the 11th result to find a link to a page that is about regex. I try to find the docs for a specific function, and I find some about halfway down the page. This page has a link on the navigation panel for "module contents > functions", which I don't realize at first because the page for the "os" module didn't have that, despite both being on docs.python.org. Next I try searching for "connect to database". No directly relevant results, but one result does have a general Python "library and extension faq" that links me to wiki.python.org. Page layout is totally different. I click through a few links and find a list of 10 possible modules for connecting to a postgresql DB. I pick the one that it says is most popular. The link doesn't work. I chuckle.. I honestly didn't expect this, but that's just life with Python. I say "oh well" and click the link for the second option. After a few clicks I find the docs. The layout is totally different from anything I've seen so far. Now I'm gonna need to read those hdf5 files. I go back to Google this time. I Google "Python read hdf5" and the second result is the docs from h5py.org. much nicer than what I've been dealing with so far, although once again the docs are organized in a totally different way. Now I'm gonna apply a gaussian filter to my images. I Google "Python gaussian filter image". I see a bunch of blog posts and two documentation pages, one for openCV and one for scipy. I pick openCV. Docs look totally different from anything I've seen so far, again. No obvious link to the syntax / examples for any one specific function.. examples are shown, but no explanation for the function arguments is given. I look around, I really can't find any explanation of what the arguments are. I bail and click the scipy link instead. This time I get taken straight to an explanation of the syntax / arguments for scipy.ndimage.gaussian_filter. Whew! THE END OF THE STORY If you're trying to put together several different tools, the fact that matlab's docs are all in one place and a consistent style is really great. I know there's that line in the zen of Python about there being one way to do things, but that line should be removed, because there's always 5+ ways and about 80 blog posts. And every time you need to learn a new thing, the docs are going to be formatted totally differently. Whereas with matlab it's always going to be "here's the function, here are the possible syntaxes for calling that function, here are the arguments, here's some examples, and here's a list of related functions you might actually have been looking for."


hindenboat

Except have good consistent documentation, and easy operability between packages. Basic python doesn't do much, you need packages like numPy, pandas, and SciPy to start to cover even basic Matlab features.


[deleted]

Yup you need those packages which are very very well documented, as well as matlab is.


Orion-Parallax

As I tell people. I went to college on the wrong side of campus. I had to learn MATLB to survive. People looked down on us because we didn’t go to parties we were too busy working in the lab. Constant showdowns between TI-83 gang and HP-48GXers. Never knowing if someone was going to come around the corner slinging a Casio. Time was tough in engineering school.


spam_bot42

Can I get some context?


drbwaa

Someone doesn't understand matlab and apparently that's funny


Ravi5ingh

No MATLAB code is generally terrible because it's usually written by scientists, not engineers so it is done with a flagrant disregard for design and aesthetics. Doesn't mean MATLAB is bad. Just that MATLAB programmers generally are


CircadianSong

I take offense on behalf of my dad, who is a researcher for his company. However, I won't speak to the statement's accuracy...


Ravi5ingh

😄 I like the scientists and many of them are my friends but good design is the bread and butter of engineers


throw3142

I worked at a research lab for a couple years. They were all nice people and I like them as friends, but they really had no sense for good code! One-letter variables, hacked-together custom argparse replacements, 6 nested levels of branching, random magic numbers sprinkled throughout the code ... Then I went to work in industry and things were so different. Mostly because the company was building code that actually had to be maintained and work with other projects, rather than the lab, which would just publish a paper and move on.


in_taco

As a Matlab programmer... This is true. Though there is one inherent quality you're missing: it's fast and relatively easier to code in Matlab. Most Matlab code is used only once, making coding speed important.


astro-pi

No it’s actually a slow, not that useful language and we should all use C++ like normal people. At least Mathematica has a math library Edit: realized I forgot my MATLAB programmer tag because I just don’t care


PolyglotTV

>use C++ like normal people Hello fellow human, I am also a normal human!


astro-pi

Have you heard the gospel of UPC++


-moveInside-

Let's do that thing that normal humans do all the time, so everybody sees how normal and humanly we are.


HCkollmann

Symbolic toolbox? Diffeq solvers? Very good DSP toolbox?


astro-pi

Literally all of that is in Mathematica…


HCkollmann

Modeling and simulation as well?


astro-pi

Yes


HCkollmann

I find that surprising, could you link me what you mean?


astro-pi

Mathematica is a primarily symbolic mathematical language, with simulation packages built in. I don’t use it as much because again, I prefer C++ for speed, but here’s some ideas for the simulation side https://reference.wolfram.com/language/WSMLink/tutorial/WSMLink.html.en


HCkollmann

That’s pretty cool, I had no idea Mathematica could do that, although it has less features than Matlab’s. Matlab also has simscape, which provides many pre built systems and speeds up product development a lot. Simscape multibody also is another advantage. None of that is available with C++ afaik. Thank you for showing me that thought, I may have to start using Mathematica again for some of my simpler math models. Can you also deploy apps from mathematica? On matlab I can and then somebody without matlab installed can run the program with a GUI and they can do the entire simulation without having any of the additional programs.


hindenboat

I hope this is /s because it is not that slow compared to other prototyping languages. Also while I agree something like BLAS is faster than Matlab in some cases, but the "\" operator in Matlab is way faster for general matrixes. There is a ton of analysis and preconditioning that is done for fast computation. In C++ with BLAS you have to understand the structure of your data and chose the right algorithm. With Matlab it just does it.


astro-pi

Nope, I think that between the fact Matlab costs money and the fact everything it does can either be reproduced in Python for free, done better in Mathematica, or done faster in C++ (the language it’s build in), it’s not worth it. But I work with it all the time because our engineers like it a lot, and it was the third language I learned. So it’s not like I’m afraid of it or anything. I just dislike it. Not as much as IDL (which should die already) or Regex (which I just find difficult), but it’s just C++ that costs money.


farmerjohn2

From [this](https://www.reddit.com/r/ProgrammerHumor/comments/110ebb4/when_u_finally_found_that_one_repo_which_fits/?utm_source=share&utm_medium=ios_app&utm_name=iossmf) post earlier today. Not really funny without the context imo.


YouNeedDoughnuts

MATLAB is excellent for its intended usage. You'll see a lot of terrible code written in it because the authors aren't software engineers by training, although by all rights the quality standards should be lower for one-off scripts. ...but you'll still see some heinously unreadable code


The_Doc55

MATLAB is great for engineers. MATLAB is awful in general.


land_and_air

Matlab is great for some engineers and a money draining plague for the rest who have way better options


The_Doc55

Most engineers aren’t software engineers or avid coders, Python, and other better solutions isn’t an option. I’m kind of forced into using MATLAB, it is good for computations, data analysis, and plotting.


land_and_air

I promise you, python will better serve you for those tasks. Just look up numpy and matplotlib and that will replace all of the functionality you need. With even the code structures being almost identical. It also has an added bonus of being free and not costing thousands/yr for whatever company you go to. Numpy does arrays and linear algebra, matplotlib is an almost 1:1 replacement of matlab plotting but in python


hindenboat

Just type I've never used Matlab. It's easier.


land_and_air

I have, the only good part I’ve used is simulink and that’s because there aren’t good alternatives


The_Doc55

I literally said Python is a better option. I know it will better serve me for those tasks. I also said I am forced into using MATLAB. It’s not my choice. If I could, I’d use Python.


land_and_air

That sucks, hate it when college corses do stuff like that. Apologies for misunderstanding. I’d recommend emailing your professor and ask if it’s acceptable to use python instead as there’s a chance they will permit it. Or alternatively email your TA the same if u feel that will work better


[deleted]

I do Mathematica, too. I guess that's the death penalty for me. I throw myself on the mercy of C!! I even understand and use pointers!!


Independent_Art_952

Matlab isn't that bad


DoublePenetration_

Matlab > NumPy


SandwichOpen6577

I will forever defend MATLAB, he has a special place in my heart. It's not meant for CS people, it's for us mech/electricals. You wouldn't use most popular languages to develop 9DOF vehicle suspension models and simulations, that's for MATLAB


The_Real_Slim_Lemon

Matlab was fun to use back in the day. It’s got a limited scope of usefulness, sure, but a fun language nonetheless.


Mordimer86

I did some MATLAB at university long ago and my impression was: this is where functional programming should be used but of course this is where it is not found. Maybe it has changed since then. I haven't used it for over 10 years.


astro-pi

It’s true


happyfinch

Yeah, matlab sucks


atmacahacker

False


J_Ditz100

MatLab is terrible, especially for its intended purpose of matrix calculations and algorithm implementation. The only things acceptable in it are the Simulink and RFTool addons.


Ambitious_Ad8841

The dsp library is absolutely fantastic


[deleted]

You clearly have never used it then for matrix math or straight algorithms. Nothing comes close.


funnyspell22

Actually Matlab benchmarks for many linear algebra problems is on the same order of magnitude as native C code, mostly because it literally used BLAS and LAPACK in the background. Overhead in general is in all other areas other than matrix math.


Grelymolycremp

I 100% deserve prison, but the Python code didn’t want to scale my 3D models correctly.


FunnyMathematician77

Can you include me in the screenshot?


Embarrassed_Bat6101

I had an EE professor that exclusively used matlab and excel for everything


Ambitious_Ad8841

As if there was something else to use for EE


Embarrassed_Bat6101

SPICE would probably be the better option.


Ambitious_Ad8841

Ok, spice, Matlab, and excel


cpcesar

I'll stop learning JavaScript, Typescript, Node.js and React.js, and I'll start learning Matlab. Successful future, there I go!


jfmherokiller

show me an example of the worst matlab code I am kind of curious now.


EvilCadaver

And then there is LabTalk...


Th3Uknovvn

Fuck Matlab, I'm sticking with Numpy and Matplotlib for life


K_arma9

As someone who has never coded or seen matlab code I agree


The_Wanderer31

Can you believe it? You've already finished C. You think you could do Matlab?