<p>I am planning to major in Pure Math at UCD, and there is a computer programming requirement of either C++ or Matlab (applied to engineering problems). I'm not exactly tech-savy and I have never even seen a line of code before. So I'll cut straight to the point, which one do you think is easier to pick-up and pass?</p>
<p>I am not trying to become an engineer or anything, I just need this to fill my major requirement. But I do think MATLAB would help with the matrix theory I'll have to learn in Linear Algebra. I also heard C++ was more for programmers who build functions from ground up, and MATLAB was for engineers who needed to compute answers to a problem (although I honestly have no idea what any of this means). Help a lowly undergrad out?</p>
<p>MATLAB is two orders of magnitude simpler than C++. If you’re not actually going to use either of them, MATLAB is significantly easier to learn.
C++ is used for making programs. MATLAB is used for solving specific problems. C++ does way more, MATLAB is way easier to use. You make something like Microsoft Word/Excel/etc (the actual program itself) in C++, and you solve for a long and convoluted mathematical equation in MATLAB.
Hope that answers your question.</p>
<p>You may want to see what computing tools are used in your math department’s numerical analysis course, your statistics department’s courses, and perhaps other similar courses involving data analysis (e.g. in economics, engineering, etc.). MATLAB is commonly used for these types of things.</p>
<p>MATLAB language is very similar to C++. You can also make programs with Matlab. One great thing about Matlab is that it has a GUI development environment which is fun. The thing is, once you learn to program, you can easily shift languages- especially between C++ and Matlab, they have only small differences, with matlab being great as it will tell you beforehand if you have a mistake in your code. C++ on the otherhand will only do that if you have a good compiler. But if you can program in one, you can program in the other.</p>
<p>For Math major, MATLAB is probably your first choice, then there is Maple and Mathemtica which are also very very popular among mathenticans. Wolfralpha is based on Mathemtica.</p>
<p>MATLAB is also a common prototyping language. You can make a GUI app out of MATLAB. Lots of CS professors do that. I even have a friend in BME did matlab app in a month for his neuron science research.</p>
<p>If you find programming interesting, please do learn C++. There is another language called Python which is extremely popular in the data analysis field. Python is magical and has NumPy, SciPy to do a lot of numerical, data analysis. </p>
<p>Last, if you are interested, there is an open-source language called Octave which tries to emulate the syntax of MATLAB. Basically, for your common MATLAB codes, you can just run that same M file in Octave without any problem, and you don’t need a license like MATLAB. Just a side note.</p>
<p>The two codes are used for different applications, so saying one is easier than the other is meaningless. Besides, MATLAB is based in C, and as a result, much of the syntax is the same. The difference lies in the application of each, where MATLAB is used mostly for problem solving applications and creating nifty plots. It can do these things quickly and easily. C/C++, on the other hand, is much more versatile in nature, but problem solving and creating plots with it is horribly inefficient and time consuming. </p>
<p>MATLAB is popular in engineering curriculm because it is aimed at problem solving applications. Also, it’s ties to SIMULINK make it very useful for control theory classes.</p>
<p>While I understand the sentiment of learning C++ first (I, too, started with C++), but one must consider the required results. The OP is not a computer science major, but a math major. His/her goal in learning to program is to facilitate with calculations of massive amounts of data. It will take considerable amount of effort and time to do what he can produce in Matlab in a couple minutes. It’s just bad engineering practice to rebuild the wheel barrow every time you want move something heavy. Go with Matlab. Had you been a CS major, I would have recommended C (not C++, but C)</p>
<p>I agree with the above post. Go with Matlab. Matlab = Math lab.<br>
If you have never programmed before, and don’t have a big interest in programming, learning C++ is a challenge. You can do lots of powerful things with Matlab much easier.</p>
<p>I’d suggest C++. It might be harder, but it looks much better on your resume that you know a programming language (no one really cares about MATLAB in the real world, and they usually use other programs).</p>
<p>Are you sure about the choices? UC Davis’ web pages indicate that a pure math major chooses between Engineering 6 (using MATLAB) and Computer Science 30 (using C, not C++). Applied math majors have to take Computer Science 30 (using C) and 40 (using C++).</p>
<p>In the “real world,” it is true that Excel is generally far superior to MATLAB for practical purposes. Numerical approximations usually suffice for industrial purposes, and Excel deals with data in a much more effective way.
There’s plenty more that could be said on the matter, but MATLAB is generally superior in research, where precision is more valuable than efficiency. Excel and the like are much better for the purposes of standard industrial work.</p>
<p>@HuskyDad: MATLAB is something that even if wherever you are working requires it, you can learn it on the job relatively easily as long as you know the calc behind the problems you are doing. C++ on the other hand is a skill that is more versatile and harder to learn. And in this day and age, whether for research or work life, knowing programming can make things tremendously easier and is almost an essential (Knowing 1 programming language can make it easier to learn another as well).</p>
<p>Plus, I’ve seen plenty of job application requirements and hardly have I ever seen MATLAB required (be it research or private industry). C++/C on the other hand…</p>
<p>If you want to talk about the real world, JPL used Matlab extensively to simulate and calculate stuff for the Mars Science Laboratory Mission (the Curiosity Rover mission).</p>
<p>This “real world” comment posted by UWhuskyDad is bogus … there are a ton of industries from automotive, aerospace, medical to defense and virtually everything in between, that use Matlab/Simulink every single day in virtually every engineering discipline. And from someone who recently graduated and successfully found an engineering job, there was no shortage of positions looking for people with Matlab experience. And to answer the Excel comment posted by NeoDymium … Excel is a powerful tool for organizing data, but it is not at all a good place to do programming or anything other than the simplest data analysis … it is much better to store your data in Excel, and then do your algorithm development in something like Matlab where you can actually see your entire algorithm (i.e. it isn’t hidden behind a veritable sea of raw data) at this point it seems as if I have made a career out of redoing quick and dirty “programs” done by an earlier generation of engineers in Excel that are exceedingly hard to follow and are typically riddled with cell errors that are very difficult to find. The beauty of Matlab is its readability which is helpful if you or someone else are ever going to be reusing the code that you write.</p>
<p>So to answer the OPs question, use the right tool for the right job, if you only need to enter and organize simple data and maybe calculate an average or sum of a column of numbers and possibly make a scatter plot then Excel is for you. If you want to do applied math/engineering, with a mixture of symbolic expressions and numerical analysis and then produce professional quality plots on the fly … then I would highly recommend Matlab. If you would like to write commercial programs, like Excel or Matlab, then a lower level programming language like FORTRAN or C/C++ is the way to go. … Hope this helps</p>