# What should I learn first, Mathematica or MatLab?

I have a non-professional interest in math and I would like to be able to be curious and play around with some math that I'm learning about (both here and from calculus-and-higher level math classes).

Mathematica and MatLab seem like the best ways to play with math. I've seen demos of both and they both seem exceptionally powerful and complex. I'd like to start learning more about the syntax of one or the other so I can develop ideas and evaluate them, but I don't know which is better suited for me. Which one should I use?

-
Given that both Mathematica and MatLab are fairly expensive and Wolfram Alpha (wolframalpha.com) is free, I'd suggest starting with Wolfram Alpha (which may or may not lead you into Mathematica), and switching to a desktop application when you hit the limits of what Wolfram Alpha can do. (This doesn't actually answer your question, though.) – Isaac Jul 20 '10 at 22:28
What is your opinion about learning how to use Excel properly? Using a spreadsheet to explore complicated behaviors (multiple iterations, function evaluations over a multidimensional domain, etc.) can be far more enlightening than simply staring at the output of a Matlab script. The spreadsheet also has the advantage of forcing one to carefully consider their question - I often find that the most important question is "What relationship am I really concerned with?". – Tom Stephens Jul 20 '10 at 22:29
a open source alternative to mathematica: maxima. – Chao Xu Jul 20 '10 at 22:39
Mehper C. Palavuzlar post is pretty accurate from what I know. All I wanted to add was that it's also very domain specific. In Brain Imaging where I work currently, Matlab is entrenched. Other fields differ. Have you considered Maple? – nkassis Aug 11 '10 at 4:14
Hmm, first time I saw this. My advice would have been to be "language-agnostic": learn concepts and techniques that are independent of a particular computing environment. Then you can easily make correspondences (e.g. MATLAB's 1:n is Mathematica 's Range[n] and Maple's seq(i, i=1..n)). You can worry about the subtle differences later when you've gotten good at being language agnostic. – J. M. Sep 13 '10 at 21:43
show 2 more comments

From helium.com:

The comparison between Matlab and Mathematica is NOT numeric versus symbolic as some claim. It is 'high level complete system' versus 'low level core with specialist toolboxes'. Mathematica can do all the numeric math and matrix work that Matlab can do, as fast and as accurately. Matlab is almost strictly a subset of the functionality of Mathematica.

Much of the wider functionality for Matlab is sold as additional toolboxes. e.g. Matlab has toolboxes for curve fitting, statistics, optimization, symbolic math, PDEs, Image acquisition etc but ALL of these areas of functionality are built in to Mathematica already. Aside from the cost and inconvenience of making you buy every function that you need separately, the Matlab design means that the core is inherently low level (since it cannot call on any of the toolbox functionality in case you have not purchased that toolbox), and many of these functions do not fit well together (e.g. no toolbox function can be used with symbolic parameters as they are all written using the numeric-only Matlab core).

Matlab's only comparative strength lies in some of its specialist toolboxes (e.g. control theory where it is dominant) but if you are not in that specialism, those are of no use.

Some specific differences between the core systems:

• Matlab is machine precision numeric only with some support for complex arithmetic - all Mathematica functions support machine precision and arbitrary precision real and complex arithmetic, exact arithmetic and symbolic computation.
• Matlab basic data model is 2D (matrices) with a pointer mechanism to emulate higher dimensions - Mathematica basic data model handles any dimensionality without extra work.
• Many of Mathematica's functions switch automatically between different algorithms (with a manual overide) - in Matlab you must always choose the algorithm.
• Matlab requires you to manually linearize ODEs to a system of first order equations before it can solve them - Mathematica accepts any order ODE.
• Matlab can do integration up to only three dimensions (with triplequad) Mathematica handles n-dimensional integration for any n.
• Matlab's language is procedural only (rather like higher level FORTRAN) - Mathematica allows programming in procedural, functional, object oriented and rule based styles.
• Matlab has text interface and a basic home grown IDE - Mathematica has text interface, document interface, GUI tools, and full Eclipse based IDE.
-
Although the functionality of Matlab is almost a subset of that of Mathematica, it is incorrect to say that "Matlab's only comparative strength lies in some of its specialist toolboxes. Matlab uses a compact readable notation for the types of numerical array operation it is commonly used for. The corresponding Mathematica notation is often highly verbose and, also important, can look very unnatural when compared to standard mathematical notation. – sigfpe Jul 21 '10 at 18:00
When you exactly copy and paste some text as an answer, I think you should indicate it more clearly. Many users might think that these are your own words. – AgCl Aug 11 '10 at 17:28
@AgCl: If readers read my answer till the end, they can easily see the source. There are loads of copy/paste answers on Stackexchange sites and most of them don't indicate a source. I'm indicating the source at the end of my answer clearly. If you downvote an answer just because it is a copy, you should really consider the content rather than it's a copy or not. – Mehper C. Palavuzlar Aug 12 '10 at 7:30
Mehper, it's fine to quote (though I'm not sure about copying an entire blog post!), but it's simply unethical to not make it clear that you're doing so. Please don't do this. :( – ShreevatsaR Aug 12 '10 at 10:39
This is a very old thread but this goes for the record: Apparently the author of the blog post did not use Matlab at all. The toolboxes,as claimed, are nowhere to be found in Mathematica, except for aesthetical cases. The claim that functionality is a subset of the Mathematica is pure ignorance. I used both for at least 10 years and both are typical commercial products. There is no point comparing them. Matlab owns the domain with hardware-in-the-loop environments and that is the largest part of its customer portfolio, finance etc. is for Mathematica. – user13838 Feb 24 '12 at 23:47
show 3 more comments

As someone who uses both Matlab and Mathematica regularly, I'd like to give some strengths of Matlab over Mathematica (since Mehper C. Palavuzlar gave such a good overview of Mathematica's strengths over Matlab)

• You can make Matlab scripts fully stand-alone. Yes, it will be a 500 MB executable for a program that prints "Hello World", but it can be run by someone who doesn't have Matlab. This also makes it possible to run your calculations in parallel on a server farm like Amazon's EC2 (is it even possible to use EC2 for Mathematica's computations?)

• Matlab has a much larger and more active community. There are more Matlab blogs out there to browse for tips and you can get answers to questions on Matlab Central within 10 minutes sometimes. Mathematica has a moderated newsgroup which is high quality, but slow -- because of moderation it typically takes one day for your question to be seen by other people

• Bigger community means more ready-to-use code out there. For instance, I started using Matlab for some visual recognition tasks, and I could get pretty much all the pieces for segmentation, low level feature extraction, adaptive thresholding etc from the web, whereas in Mathematica I would have to implement them from scratch. It's common for researchers to publish Matlab code they used for their computations on their homepages, whereas I'm yet to see anyone (at least in vision/statistics/optimization) publishing Mathematica code to go with along with their papers

• Matlab's language is easier to learn (and to debug!). Mathematica offers an "rewriting system" paradigm unfamiliar to many, and even after years of programming in Mathematica I occasionally run into unexpected behaviors due to some intricacy of the evaluation sequence

Overall, I'd recommend to go with Mathematica if you want to play around by yourself, and Matlab if you want to share your code or use code of others.

-
Agree, but to comment, Mathematica has very good documentation and also a very extensive book written by Stephen Wolfram himself about 970+ pages of details of Mathematica. But on the contrary, so does MatLab, and that is what I use mostly to learn things. So all in all, both are great for self-learning although it will take some effortless work and patience to learn shortcut and better algorithms and syntax to perform certain tasks as with any language. – night owl Jun 3 '11 at 11:57
Mathematica now also has a stackexchange :) – BlueRaja - Danny Pflughoeft Apr 19 '12 at 15:25

As a free/libre alternative to Mathematica, you may want to have a look at Sage for Python.

As a free/libre alternative to MATLAB, which duplicates almost all of its functionality, have a look at GNU Octave.

That said, Mathematica is a beautiful system that has no equal.

-
Sage is the way of the future. – Noah Snyder Jul 21 '10 at 16:56
Python is the way of the past. – msutherl Aug 14 '10 at 18:34
Octave is the way of the present. – timur Nov 6 '12 at 4:38
Yes, but Octave doesn't fully implement all the functionalities of Matlab. – Ricky Robinson Feb 5 at 15:02

Conventional wisdom is that Matlab is the natural choice for numerical computation, whereas Mathematica is better for symbolic calculation and manipulation. Both can do both, and it's probably a matter of taste and the convention in the fields you're interested in. Matlab is much more widely used across the sciences and engineering, so if you've any interest in that direction, it might be more helpful for you to know.

-

On a slightly different angle, Matlab is widely used in engineering, while Mathematica is more used among mathematicians. If I had to learn just one, I'd go with the one most used in my field.

Mathematica is also much cheaper for personal use (I think they have a licence for a few hundred dollars for home use, and even cheaper versions for students).

-
For students, Matlab is also pretty cheap and includes most of the important toolboxes as well as Simulink. – walkytalky Jul 21 '10 at 16:59
@walkytalky: Right, most toolboxes but not all=expensive choice in the long run. I say go open source (octave). – night owl Jun 3 '11 at 12:03

It seems you want to give it a try and play around a while before you jump into, if at all, seriously. I recommend you learn Python. Then use Sage. You'll have lot of fun, I bet. It's awesome. Learning python not only will lead you to sage, it'll lead you to several other python based computing environments. See python's website for further reference.

-

If you have prior programming experience, Matlab will probably seem more intuitive. Mathematica's notions about structure, layout and order of execution can often be vexing to the coder mindset -- as can its set of operators, which we might charitably describe as rich.

Similarly, the notion that it is helpful for programs to resemble what a mathematician might scrawl on a piece of parchment, with a quill pen, is one you will either love or hate...

-

Both softwares are robust and useful based on my experience. It isn't fair to say one is absolutely the best and the other one should be fed to the dogs. I suggest trying both (if you're a student, you typically can get it free or discounted) and seeing which one feels more natural. I believe it is better to learn something that can do anything mathematical (Yes, both Mathematica and Matlab can do the same stuff) extremely well and adapt to a specific problem then to only become marginally good at both, despite a clear advantage of application. In context to school, you probably only have a limited time to learn any of the languages so you might as well use one and become an expert at it.

-

MatLab is a numerical computing environment. Mathematica is about symbolic manipulations.

Mathematica helped me with calculus and some number theory problems. Almost everything I need is built into Mathematica, i can't say the same for MatLab. The math professors in my school uses maple(closer to mathematica than matlab).

You can have the good of both worlds, there are mathematica toolbox for matlab.

If you find the problems on project euler interesting, mathematica are something you want to look into.

-
 Isn't a Maple library built into Matlab? – BlueRaja - Danny Pflughoeft Jul 21 '10 at 0:51 @BlueRaja I thought Maple only provide a toolbox for MatLab, like Mathematica. – Chao Xu Jul 21 '10 at 1:23 Blue Raja: Not anymore. It used to be the case, but Mathworks have their own symbolic toolbox now. – Bossykena Jul 21 '10 at 14:21