r/AskEngineers • u/SomeMuayGuy21 • Mar 16 '19
Mechanical Is it worth learning Python as a Mechanical Engineer?
Greetings, I am a freshman in Mechanical engineering and I've already finished my MATLAB course, and I find coding fun, so I was wondering if I should learn python? But of course I won't waste my time learning it if it isn't beneficial to me. So my fellow MEs, how useful would it be learning python? And what are these benefits. Thank you!
296
Upvotes
View all comments
Show parent comment
6
u/Wetmelon Mechatronics Mar 17 '19
https://www.mathworks.com/help/matlab/matlab-engine-for-python.html
Basically it allows you to write like this:
Now eng is connected to a shared matlab session, or a headless session if it doesn’t find a shared one. Then you can make calls. For example...
Check if a number is prime:
Plot some data (no output arguments):
Your more complex tasks are also possible, like code generation.