Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

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?

share|improve this question
8  
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
3  
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
11  
a open source alternative to mathematica: maxima. –  Chao Xu Jul 20 '10 at 22:39
3  
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
3  
Sage and FreeMat –  timur Nov 6 '12 at 4:29

10 Answers 10

up vote 52 down vote accepted

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.
share|improve this answer
11  
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. –  Dan Piponi Jul 21 '10 at 18:00
23  
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
9  
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
6  
My experience disagrees markedly with "Mathematica can do all the numeric math and matrix work that Matlab can do, as fast and as accurately." I'm finding Matlab much faster; scripts run 10-100 times as fast as in Mathematica. It's not true that you must always choose the algorithm in Matlab. –  Jitse Niesen Mar 17 '11 at 17:24
9  
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

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.

share|improve this answer
    
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
14  
Mathematica now also has a stackexchange :) –  BlueRaja - Danny Pflughoeft Apr 19 '12 at 15:25
1  
You can also create standalone compiled scripts with Mathematica, wolfram.com/mathematica/new-in-8/integrated-c-workflow/… –  skan Jun 23 at 19:09

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 or Julia.

However, Mathematica is a beautiful system that has no equal. You will not find another system as comprehensive, well designed, and well documented.

share|improve this answer
20  
Sage is the way of the future. –  Noah Snyder Jul 21 '10 at 16:56
2  
Python is the way of the past. –  msutherl Aug 14 '10 at 18:34
2  
Octave is the way of the present. –  timur Nov 6 '12 at 4:38
1  
Yes, but Octave doesn't fully implement all the functionalities of Matlab. –  Ricky Robinson Feb 5 '13 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.

share|improve this answer

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...

share|improve this answer

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.

share|improve this answer

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).

share|improve this answer
    
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
2  
@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

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.

share|improve this answer

If you wanna be an engineer:

Maple + MatLab, that's for sure. Maple for symbolic and matLab for numeric!

Mathematica is more a general purpose, low level mathematics. For hardcore mathematics there is only matLab, ain't no way around...

share|improve this answer
    
I'm not saying that Mathematica is useless! I use it very extensively! I only use maple/matLab (or c++) in case that mathematica fails, which happens more often as things get more complicated, sadly :(. I would wish that there was a magic program that could solve any problem presented. –  Electro geek Oct 9 '13 at 12:05
    
I'm not saying that Mathematica is useless! I use it very extensively! I only use maple/matLab (or c++) in case that mathematica fails, which happens more often as things get more complicated, sadly :(. I would wish that there was a magic program that could solve any problem presented. All I'm saying is that if you wanna be en engineer there ain't no way around maple/matLab. I would wish that it was. Mathematica helps a lot but one can do without. There ain't no electro engineer whom can do without control toolbox! To a question on witch to learn first: Mathematica!! Good luck all :) –  Electro geek Oct 9 '13 at 12:13

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.

share|improve this answer
    
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
    
Mathematica is both numeric and symbolic. Symbolics with Mathematica are much more powerful. Numerics almost the same. And Mathemtica is better with big numbers and abstract algebra. The only advantage of Matlab is that it has some predefined engineering applications not found in Mathematica. –  skan Jun 23 at 19:12

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.