Stories
Slash Boxes
Comments

SoylentNews is people

SoylentNews is powered by your submissions, so send in your scoop. Only 15 submissions in the queue.
posted by Fnord666 on Thursday September 12 2019, @07:16AM   Printer-friendly
from the switching-gears dept.

MATLAB and Python are both rather popular languages. Real Python has an overview of the two with an eye towards encouraging use of Python. There is a lot to say when comparing languages, so this is a long read.

MATLABĀ® is widely known as a high-quality environment for any work that involves arrays, matrices, or linear algebra. Python is newer to this arena but is becoming increasingly popular for similar tasks. As you’ll see in this article, Python has all of the computational power of MATLAB for science tasks and makes it fast and easy to develop robust applications. However, there are some important differences when comparing MATLAB vs Python that you’ll need to learn about to effectively switch over.

In this article, you’ll learn how to:

  • Evaluate the differences of using MATLAB vs Python
  • Set up an environment for Python that duplicates the majority of MATLAB functions
  • Convert scripts from MATLAB to Python
  • Avoid common issues you might have when switching from MATLAB to Python
  • Write code that looks and feels like Python

Earlier on SN:
Python's Guido van Rossum Steps Down (2018)
What's Today's Top Language? Python... no, Wait, Java... no, C (2017)
GNU Octave - Open Source Answer to Matlab - Hits 4.0.0 (2015)
You Want MatLab on Your Resume to Get a Job at Google (2014)
Why Python is Slow: Looking Under the Hood (2014)


Original Submission

 
This discussion has been archived. No new comments can be posted.
Display Options Threshold/Breakthrough Mark All as Read Mark All as Unread
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
  • (Score: 0) by Anonymous Coward on Thursday September 12 2019, @07:34AM (8 children)

    by Anonymous Coward on Thursday September 12 2019, @07:34AM (#893081)

    Make sure you migrate to Python 2.7 so you can re-write everything when it goes away [soylentnews.org].

    And since the Python guys seem to want to obsolete stuff all the time, you'll probably get to re-write it again in a few years too.

    Talk about self-serving drivel. Sigh.

  • (Score: 1, Funny) by Anonymous Coward on Thursday September 12 2019, @08:10AM (4 children)

    by Anonymous Coward on Thursday September 12 2019, @08:10AM (#893085)

    Make sure you migrate to ...

    Javascript. It will be around when COBOL and Perl have long died. Or at least when they are only running on a JS engine.

    Python and Ruby have already died and are legacy.

    • (Score: 2, Insightful) by Anonymous Coward on Thursday September 12 2019, @01:47PM (3 children)

      by Anonymous Coward on Thursday September 12 2019, @01:47PM (#893154)

      Realmen(tm) use Fortran.

      • (Score: 0) by Anonymous Coward on Thursday September 12 2019, @03:13PM (1 child)

        by Anonymous Coward on Thursday September 12 2019, @03:13PM (#893186)

        Realmen enter in their code by front panel switches

      • (Score: 2) by UncleSlacky on Thursday September 12 2019, @08:20PM

        by UncleSlacky (2859) on Thursday September 12 2019, @08:20PM (#893312)

        I can write Fortran in any language!

  • (Score: 1, Informative) by Anonymous Coward on Thursday September 12 2019, @12:53PM (1 child)

    by Anonymous Coward on Thursday September 12 2019, @12:53PM (#893139)

    While Matlab has never "gone away", Mathworks do change things around and break older code by removing or changing functionality. Another annoying thing Mathworks does is take perfectly good functions out of the mainstream Matlab and move them into specialized toolboxes, clearly a money grab.

    • (Score: 0) by Anonymous Coward on Thursday September 12 2019, @06:29PM

      by Anonymous Coward on Thursday September 12 2019, @06:29PM (#893262)

      They also allow single precision and complex numbers, however 1/2 the functions barf if you use those types. Any they will not fix it - just template the underlying C++ for CHRISSAKES.

  • (Score: 0) by Anonymous Coward on Thursday September 12 2019, @05:26PM

    by Anonymous Coward on Thursday September 12 2019, @05:26PM (#893236)

    "All the time"

    Python 3 was introduced in 2008, so you should have at least a good solid 12 years before it goes EOL after they release Python 4 (for which there aren't yet plans).

    Are we going to be upset that they aren't still supporting Python 1 as well?