12 Replies Latest reply: Nov 10, 2016 4:01 AM by KarlB.S. RSS

    MathCad vs. Matlab?

    JohnRudnicki Bronze

      Can someone (or several) offer some comments about advantages of one vs. the other? I realize that could be a long answer and I am just looking for some general guidance.


      I have been a longtime MathCad user (though not necessarily a particularly adept one). Recently I decided to learn Matlab and started doing this by rewriting some Matlab programs in MathCad (although the reverse might seem more sensible). Although MathCad has obvious advantages for combining text and calculations in a more or less free form way, my impression is that MatLab offers many programming advantages. For example, fzero seems to work more robustly than root, MathCad seems to have no function equivalent to fminsearch or fminbnd, it treats NaN differently (MathCad returns 0).


      Attached is a MathCad worksheet and the equivalent (?) Matlab files.

        • Re: MathCad vs. Matlab?
          rschor Bronze

          I've used all of the "M" systems (MathCad, MatLab, Mathematica, and Maple). It really depends on what you need to do in deciding which system is "best". Here are some considerations that I've used ...


          I started with MathCad first. I needed something that would let me express mathematics to do some simple analysis, make a few plots (for my own edification and for teaching purposes), and, most important, would let me create documents that combined text, math (meaning equations, usually), and graphics that could be used for teaching or other didactic purposes.


          At a certain point, I needed to analyze a lot of data, often multi-channel analog samples from a variety of sources. In some cases, complicated calculations involving these data needed to be performed. For example, I might want to know the 3-D orientation of an object (roll, pitch, yaw), given voltages measured by coils fixed to the object inside a stationary magnetic field. I used MathCad to develop and test the equations to take the signals (voltages) and convert them (through multiple steps, including getting "scaling" information from other files) into a series of three components representing roll, pitch, and yaw (these eventually were converted to rotation vectors). For doing the "number-crunching", involving multiple files and megabytes of data, I used MatLab, as I found it easier to handle the "point the program at the following directory and let 'er rip" with MatLab than with MathCad.


          A number of years ago, I started working on an even more complicated problem involving vector-like objects in a six-dimensional space. I needed to be able to "point it at data", like MatLab, but needed more sophisticated math ability, like MathCad. However, the MathCad at the time (12? 13? I'm not sure) didn't seem up to the task. So I bit the bullet and tried Mathematica. This definitely has all of the "power" that I could imagine, particularly in the "solving" arena (which is where MathCad had let me down). However, its ideosyncratic syntax (basically, you need to learn an entirely different set of "rules" for things like parentheses, square and curly brackets, upper and lower case) gave it an extremely steep (and rocky!) learning curve, not something I would want to turn to for a simpler problem. While it does support the creation of documents that combine text and math, the math is in Mathematica syntax rather than looking more like equations we can intuitively grasp, as MathCad provides.


          At this point, needing the math capability of Mathematica but wanting the syntax and ease-of-use of MathCad, I decided to try Maple, which I understood to be a MathCad "parent". I must confess I probably did not give it a fair trial, as I was put off by the difficulty of entering "math" into the system (compared to MathCad), and the relative lack of transparency and intuitiveness of the system.


          I've just downloaded and installed MathCad Prime 2.0 (I "passed" on Prime 1.0 because it lacked 3-D plots and symbolics (both of which I use). I'm hoping and planning to "get re-acquainted" with MathCad for my algorithm development, modelling, and data analysis (not of the "number-crunching" variety, but I might decide to "give it a try" ...).


          Bob Schor

          • Re: MathCad vs. Matlab?
            FredKohlhepp Platinum



            I like Mathcad! It's easy to learn to use (once you've climbed the "learn the editor" hill. You don't have to learn a programming language. (I'll concede that Matlab is much easieer than FORTRAN, but it's still a programming language.) Mathcad handles units. And I can do in Mathcad practically whatever others can do in Matlab.


            In my experience, Matlab handles file I/O better than Mathcad. (Some people have been writing DLL's and scripts to address that, you can find a wide assortment here.) And I suspect that Matlab may have an advantage with HUGE quantities of data. (Mr. Jackson may have an input.) Matlab can create a page of graphs as a stand alone image; I really wish Mathcad could do that. But I can read a Mathcad sheet and understand it--it looks like hand written math. Pray tell, what is fzero? fminsearch? (Admitted: soome of the Mathcad functions can get isoteric too.)


            Depending on your setup, cost may be an issue. According to my IT accountant, a Mathcad "seat" is much cheaper than a Matlab "seat."


            From someone who has been advocating Mathcad for a long time.

              • Re: MathCad vs. Matlab?
                JohnRudnicki Bronze

                Fred, Bob,


                Thanks for the interesting comments.


                Like Fred, I have been happy with MathCad and been able to do most of what I needed to do. But in my world (ivory tower academia), MatLab seems to be a much more popular platform. I put off learning it for a long time, but my recent motivation was in some MatLab programs for analyzing errors in shooting a basketball. I started out rewriting them in MathCad just to make sure I understood them. Along the way I realized I needed learn some MatLab – which led to my question. MatLab does seem to have advantages for certain operations (some mentioned by Bob), but I will likely need much more persuasion to be a convert. Nevertheless, it has been helpful and interesting to know a bit more about MatLab (though, as you may have judged by my previous posts, I am not by any means an expert in MathCad). As someone who cut his teeth on Fortran many decades ago, I have been happy to leave that in the past. I have friends who swear by Mathematica, but I am not about to tackle that or Maple.

                • Re: MathCad vs. Matlab?
                  KarlB.S. Bronze

                  Sometimes there is more to a product than we know about it.


                  I had seen some programming steps written for a protection relay response, the Mathcad file plus it had a data file associated to it. I was surprised to see the level of programming similar to Fortran for instance. I realised then that it had its ability to be a cad like and programming software. That was in a formal course at Uni of Idaho. Now I am getting into signals and systems thru a tutorial book for Mathcad, plus an engineering textbook.


                  So it takes me a while to get the entries and syntax right, slowly I am making progress. I say to myself there cant be anything more Mathlab can do for what I am doing now, and if it could it would be more of a GUI input.


                  So thus far I am pleased with Mathcad but I need to study its programming side. I got me a textbook with some Mathlab files in it too, but I have to do the signals and systems in Prime first. Then hopefully I will be able to do the coding for filters and other topics for the relay algorithm in the textbook in Prime.


                  I dont know if Prime student version has the full programming features, because I had not seen anything like how to write a function pass the values etc.


                  I am on a slow and steady rate which need NOT be accelerated!


                  I had the same question John Rudniki had, and also asked it on a portal called Stack Exchange Signal Processing, the moderator there felt it was a personal preference and the replies would be opinions and requested I rewrite the question I wanted to post in the group.


                  I would suggest if your'e young in the 30s and 40s and are using Mathcad or Prime, that you should also pick up with Mathlab if the area you are involved in has those packs in Mathlab.<--- Time issue.


                  I say Mathcad has many features and areas that are applicable to electrical engineering, more so than other fields. From probability to signal processing, transforms, and lots more. I am comfortable with Mathcad Prime but would not mind learning Mathlab for some speciality area where industry might have preference.


                  In the tutorial book on Mathcad it has a very short chapter on interface with National Instrument as well. 


                  My conclusion start with Mathcad Prime and when need arise study Mathlab.


                  Programming in Mathlab is closer to programming in a language like Fortran Python etc while in Mathcad for me so far its not programming but how to effectively use the few commands in the student version.


                  Reply also intended to John.

                • Re: MathCad vs. Matlab?
                  ptc-4695363 Copper



                  I am a PhD student at the University of Kansas. Today was the first day of class. My Probability professor recommended that we purchase Mathematica. Before I go down that road, I thought I'd ask your opinion on which one of the discussed M software packages would be best suited for a PhD student majoring in civil engineering with an emphasis in transportation?


                  Any information that you guys can give is greatly appreciated.


                  -a lost PhD student

                    • Re: MathCad vs. Matlab?
                      ValeryOchkov PTC Community Champion

                      I think if your professor knows Mathematica he recomends you this M software.

                      And if your professor knows Mathcad he recomends you this M software etc.

                      But I think Mathcad is better for future civil engineers!

                      • Re: MathCad vs. Matlab?
                        rschor Bronze

                        In my opinion, Mathematica is best for mathematicians. If you are going to be doing a lot of "number-crunching", particularly if your numbers are ASCII strings in a file, and you are doing fairly simple things with them and want something quick, MatLab isn't a bad bet. It is basically an "interpreter" (like BASIC), and is definitely a "text-based" language (so you'll have some syntax to learn).


                        However, if you are going into engineering (as you are), and are likely to be doing a mix of data analysis (which includes number-crunching) and possibly some theoretical/experimental work (I notice you're taking a Probability class, so you might do some Monte-Carlo type simulations, such as estimating pi by figuring out the probability that a needle lands on a line when dropped onto a set of evenly-spaced parallel lines spaced the length of the needle), you'll probably find that MathCad is more intuitive, easier to learn, and has tools (such as the ability to create "text" documentation, to have the "program" and graphs be readable by people who don't know MathCad, and to include units to prevent mixing inches and meters inappropriately) that get the software "out of the way" of solving the (engineering) questions you really want to ask.

                        • Re: MathCad vs. Matlab?
                          Ninetrees Silver

                          I am a physics PhD student @ UNH. I own (30+ years)and operate my own scientific engineering company. (Coming back to school is a journey in itself after so long, but that is for another time. ;-)


                          I have been using Mathcad for decades (since the mid 1980s? V1). I am an early adopter of tools that show promise, and Mathcad was one of those. For some time, it was the only tool that did what I needed, though other tools had/have their own strengths. I now use Mathcad 14/15 (1st choice), MATLAB (2nd choice), Maple (3rd), and just began looking into Mathematica. I use Mathcad 15 rather than Prime 2.0 because of shortcomings in Prime, but Prime is now getting up to steam, so I try to develop in parallel until Prime fails me, then I switch back to M15. The problem with that approach is that there is no converter for Prime > M15, but there is M15 > Prime, so I will not commit any serious work at this point to a draft in Prime, expecting that I will want to redo it in M15. Prime 2.0 is not the tool for you as a PhD candidate.


                          I find Maple very powerful as a math analysis tool...much more so than Mathcad. Great solvers and plotting features. But the user interface is arcane, units are handled in a manner that seems unique to Maple, and is not a clean process (through Maple 16, at any rate), and documents are not easy to format unless one accepts the Maple presentation style. All these items have been on the table for years with the folks at Maple, so I don't expect changes soon.


                          MATLAB is very powerful, and includes data handling features that I need in my work (space plasma physics) that are not available in Mathcad. In addition, programming is more intuitive in MATLAB for me (extensive background w 3G, 4G programming languages) than Mathcad. It is fast, well supported by MathWorks, has a great user community, has a student license, and is far, far, far, far, easier to manage, license-wise, than any PTC product. The same goes for Maple. I currently run several versions of Maple and MATLAB side-by-side on the same platform, with no problems.


                          Mathcad 15 is the fastest to prototype models in, and the units checking is one of the most valuable features. I recently "checked" a published equation that I wanted to use, only to find that it contained en error, an error that would have been much more difficult to find without unit checking. (Complicated expression involving current-voltage characteristics of swept Langmuir probes in tenuous plasma.)


                          One of MATLAB's weaknesses is its graphics capability (can't even get sub-tick grid lines on plots). Here at the U, math and physics folks disdain Mathcad as a toy, and prefer Maple. Over in Engineering, folks use Mathcad extensively. I have been "sneaking" my work by in Mathcad, while some of my peers think that I am using MATLAB. As a result of Mathcad's (14/15) better document features, I have been erroneously dubbed the king of MATLAB ;-) OTOH, I am currently working with data files in CDF (Common Data Format), not available in Mathcad.


                          MATLAB offers a very intuitive, text-based programming environment, comfortable for me because of my history. I consider the programming UI in Mathcad unintuitive in many instances, and even after years of [infrequent] use I find myself stumbling and coming here for advice.


                          In summary, I find Mathematica to be an intriguing prospect for the future, with it's own direction that fills an important niche. If you were an undergad or a math major, I might recommend Maple (different reasons for each case). I recommend getting a student license for both Mathcad and MATLAB, and using them regularly. Use M15, not Prime. Use the Mathcad and MATLAB forums often for browsing and seeking help. My experience is that help is very forthcoming when one shows a good faith effort to solve the problems. All of the tools have their peculiarities, and all will require a learning curve. I consider Mathcad and MATLAB to have the shortest curves, with the biggest ROI.



                            • Re: MathCad vs. Matlab?
                              PhilipOakley Gold

                              +1. I fully concur with Rich's assessment. I use MathCAD and Matlab and they have complementary strengths.


                              I only wish MathCAD would drag across some of the N-dimension handling, the ease of programming, and the range selection (e.g. matlab's colon (:) operator) and it would have a much better chance of success in my market area (reseach->product development).


                              At the moment it looks like PTC is focusing on 'drawing office support' style calculations, which doesn't bode well for the advanced analytic and concept development style working that most of MathCAD'd historic clientele was involved with.



                                • Re: MathCad vs. Matlab?
                                  Ninetrees Silver

                                  N-dimension handling, the ease of programming, and better range use are all so fundamental that one wonders why they are not addressed better in Mathcad. (It's not clear where all the M-products are headed in the next few years; we have many examples of fine products ruined by misguided manangement. A visit to a forum for each tool will show that there are comments just like those above regarding each tool. Just change the words.) Mathcad and MATLAB are definitely my go to math tools. I (develop & document) (models & design basis calculations) in Mathcad, and turn to MATLAB when I need its features (beginning of post, for starters; data handling, &c.). MATLAB has some good simple GUI handling built in, making it easy to throw together analysis programs that are more convenient than having the user modify 20 (or whatever) parameters in a config file just to run a different sim. My source of frustration with Mathcad these days is that it /is/ my go to tool, and twixt M15 and Prime, and Windows x32 and x64, and .NET and Java (I guess), it just is not as predictable as it was in the past. Doesn't mean that it is not useful, just that it is less stable than in the past. FWIW, you should have seen the hoops that I needed to jump through in MATLAB to get one of my larger sims to run recently. (I didn't /want/ to learn Java programming, ...). In spite of these comments, I unhesitatingly recommend this pair of tools to any undergrad, grad student, or professional. And the student pricing means that one can have both products for about $200. Upgrading alternate years means staying fairly current for ~$100/yr, an excellent way to blow the cost of 80 cups of joe.



                                    • Re: MathCad vs. Matlab?
                                      JohnRudnicki Bronze

                                      Thanks to all for the Interesting discussion, many by users much more sophisticated than I. MatLab is the recommended platform here (Northwestern Engn) and, after 30 years of not finding much use for it, I managed to learn a bit this summer (which prompted my original question). But I find that nearly everything I want to do I can do in MathCad (and the ease of inserting text makes it easier to document, which I am usually remiss in doing).