[ 3 / biz / cgl / ck / diy / fa / ic / jp / lit / sci / vr / vt ] [ index / top / reports ] [ become a patron ] [ status ]
2023-11: Warosu is now out of extended maintenance.

/sci/ - Science & Math


View post   

File: 19 KB, 468x365, _MATLAB.gif [View same] [iqdb] [saucenao] [google]
5404510 No.5404510 [Reply] [Original]

what should I learn, mathematica or matlab? (or other options)

I'm studying physics and I recently got a small investigation project that requires any of these. Haven't talked yet to the professor so I'm not certain how's it going to be. I just know it's about chemical reactions and that it's recommended knowledge in any of these.

I know python, if it matters, and next semester I'm taking a C++ course, so if any of these is similar / can help each other that would be nice. Maybe I can convince the professor to let me use one of these languages? does that make any sense?

Also, I'm using GNU+Linux, so compatibility would be nice. Welp, I'm pirating anyway.

>> No.5404518

>>5404510
octave is free too bad it's slow as fuck

mathematica is inexpensive for personal use

matlab I think has the most libraries and shit downloadable and/or included

>> No.5404530

If you just need a math software, try Sagemath. Alternatively, you can use Python, sympy, and matplotlib and whatnot.

Mathematica is what many physicists would probabl yuse. Matlab is used for numerical computations by engineers.

>> No.5404539

>>5404510
Matlab is used in more universities. It handles vector processing better (linear algebra) and M code is the basis of a lot of commercial devices. NI Labview uses the same math processes and M code converts nicely to other real visual languages (not that Microsoft stuff but real visual processing). Lots of toolboxes for cool stuff, and a better database integration than Mathematica.
That being said, I think mathematica handles symbolic manipulation better.
Graphics on both are about the same.
IMO: Mathematica for higher level theoretics and weird automata, Matlab for linear algebra, wavelet and dsp, numerical analysis, and engineering. Either one might help you get a job, but Matlab is used more.

>> No.5404576

>>5404510
scilab is free

>> No.5404606

>>5404576
Not OP but do you have any good scilab tutorial?

>> No.5404612

>>5404606
try the fucking scilab site you douche

>> No.5404676

Mathematica is a bit simpler to learn, it's the type of language where you have a lot of little plateaus where even if you don't know everything you can still do quite a lot. It's great for data analysis and modeling but not very good for doing actual programming.

Matlab is still pretty good for data analysis but is much better than Mathematica for writing actual programs. Lot harder to learn though in my opinion.

(might be a little biased on that last point, I'm still very early in the process of learning Matlab)

>> No.5404677

matlab for sure, no brainer

>> No.5404721

As a physicist, the answer is clear as fuck: learn both.

>> No.5404726

>>5404676
MATLAB's ease of use depends on whether you come into it from other languages or if it's your first language.

If it's your first, it's a great starter language. The syntax is pretty simple to learn, the documentation is really helpful, and the way you can keep track of all your variables and their contents and types at a glance with the workspace viewer is really handy.

If you're coming in from another language, it's a little more tricky. MATLAB is one of the few languages that indexes starting from 1, and since matrix manipulation is its main strength, writing efficient MATLAB code often requires thinking about how to adapt your computation to use matrices, which can be difficult if you're not prepared for it. Also the syntax for writing loops is kinda ehhh if you're used to more rigorous standards.

Also, don't listen to people who say MATLAB isn't OO, because it is. It's just kinda clunky to use.

>> No.5404732

>>5404726
> caring about OO

>> No.5404742

>>5404721
even if I will know python and c++?
sorry if that 's a stupid question, I'm still not sure of what uses can I give to matlab and mathematica.

>> No.5404751

>>5404742
If you know C++ and Python, learning Mathematica should be not a problem for you.

Why would you do this?

As a physicist, you are supposed to find answers to non-trivial questions. Finding these answers requires the use of various tools and knowing more tools increases your ability to get your shit done quicker.

Mathematica is a fantastic tool if you need to combine symbolic and numeric maths, has a top-notch numerical integrator, DE solver etc.

>> No.5404962

>>5404518
>octave

anyone who mentions that shit need to be beaten to a pulp

>> No.5404965

>>5404962
thread was already polluted with C++ from the get-go, might as well mention anything at that point

>> No.5404972

>>5404965
but C++ is the best default language to code in.

>> No.5404975

Matlab, then learn how to use MEX-files to combine Matlab code with C/C++/FORTRAN code.

>> No.5404982

>>5404972
"Best" is not an objective term. Apart from the trivial definition of "best default programming language" being "C++" I cannot imagine what criteria you would use which would coincidentally happen to select C++.

But if you have them handy, dear sah-gay-er, I'm willing to listen.

>> No.5405013

>>5404982
Not that guy, but almost all game engines, numerical software libraries, browsers, and Windows and LLVM are written in C++. It is the only practical language that is both OO and reasonably fast.

So for many areas, yes it is the default.

>> No.5405020

>>5404510
>>taking a C++ course
Then learn C++, if you are required to take C++ course then there is likely a damn good reason why you need to take it.

If you want to hack around with someone else's custom library it's probably gonna be written in C++. If you need to write your own complicated code that needs to run on a supercomputer, learn C++. If you want your code to run fast use C++, it'll run quite a bit faster than any scripting language(python, matlab, mathematica).

>> Maybe I can convince the professor to let me use one of these languages?
probably not.

That is not to say that matlab and mathematica don't have have their uses. Matlab's good when you're playing around with lots of matrices, mathematica's good if your lazy with complex math. Both are good for prototyping complex algorithms. They are easy to work with, but they tend to be slower than C++. Both are fairly easy to pick up if you know how to program in general.

>>5404539
>>LabView
Get The Fuck Out of here man. Digging around for blocks is not fun. It's great if you're a technician and are hacking around with manufacturing equipment, but that's about it. If you are used to writing code, you will hate it.

>> No.5405280

>>5404962
What's wrong with Octave, it's essentially a lesser version of MATLAB, but free. Knowing one means you'll know the other.

>> No.5405286

>>5405280
nothing, it's the true matlab, matlab itself used to be free

Then some asshole decided to charge for it and here we are today.

>> No.5405304

>>5405286
Yes, well, my unis programming course taught us in Octave (they were probably to cheap to buy Matlab licenses) and afterwards we all pirated matlab, it's the same syntax (we even used matlab language in note++ to write everything we needed for Octave) only matlab has more and better functions overall, though Octave has a few useful ones that matlab doesn't.

Also, quick question; I should really learn C++, but there are so many resources available that I have no idea where to start, any suggestions from anons ITT?

>> No.5405319

>>5405280
Because its only pro is that you can jerk off to the source code. If you're a student, you're expected to be smart enough to torrent it; if you're a company, you should have enough money to license it. There's no excuse to use octave other than pure OOS faggotry

>> No.5405355

>>5405013
> C++
> OO
only if you sacrifice everything that makes OO a reasonable paradigm for a small class of problems does C++ qualify

> all dem libraries
I'd guess that 99% of languages in existence have access to the same libraries

> Windows
I fucking puked.

>> No.5405356

>>5405280
> If you need to write your own complicated code that needs to run on a supercomputer, learn C++.

I work in HPC and can tell you that you should NOT use C++ on a cluster. Ok, its faster than python (not hard) but it has so many issues (unstable ABI, Compiler bugs, crappy libs). If you want to run fast use Fortran or plain old C

>> No.5405358
File: 185 KB, 1280x1024, Octave Master race - Copy.jpg [View same] [iqdb] [saucenao] [google]
5405358

>>5405319
Maybe I just like the logo

>> No.5405361

>>5405319
> pirating software
full of failure, seriously, go to /v/ if you're going to be such a fucking faggot

>> No.5405366

>>5405361
We pirate it when we can't afford it and learn how to use it so we'll buy it when we can afford it.

But lets not start the 'software as IP' debate on /sci/.

>> No.5405378

>>5405356
>implying there's a major difference between C and C++

>> No.5405386

>>5405361
Matlab is the only software I pirate. Hell all the professors that teach Matlab recommend pirating it along with all the toolboxes. Mathworks is not in the business to make money off students.

>> No.5405414

>>5405378
> not knowing anything
There's a reason people who give a fuck use C. It's because they know what they're doing, and you don't.

>> No.5405440

You are comparing apples and pears. You can anything with either, but in general Matlab for numerics and Mathematica for symbolics. Also engineers use Matlab and physicists use Mathematica.

>> No.5405468

http://www.amazon.com/Mathematica-Cookbook-Sal-Mangano/dp/0596520999/

easy to find as a pdf

>> No.5405556

>>5405020
Dising LabView. Sigh.
1. The vast majority of problems you will encounter in the real world, require one solution, one time: separating noise from data, testing for stochastic compliance, finding the cheapest route.
2. Writing code always sucks. It will not work the first time. You will transpose a letter. You will get errors.
3. People will have solved it before you. Why reinvent the wheel?
4. The majority of your time should be spent on the problem, not the code.

I use LabView. It's fast. I can try 5 different approaches to a problem before my colleagues can cut and paste the broken C++ function from a library. I can step through the flow the way MY mind works, not the way an optimized piece of code works.
If I or someone else have a mathematical trick that works better than a function block, I can put the Matlab M-code strait into the program flow.
The BIGGEST problem you will have is data acquisition. From databases to GPS to temp sensors to powerplant error codes, getting data into the computer is a nightmare. LabView makes it easy.
My conclusion? If you are writing commercial applications for something that has to be done over and over, learn C++.
If you want to solve problems, find a tool that works for you. After you have solved the problem, and you think it will come up again, then hire someone to write it in an optimized way that can be used on many platforms, using C++ or suitably portable code.
It is just plain stupid and ignorant to worry about the mass production of a solution when the problem will never be encountered again.

>> No.5405582
File: 45 KB, 256x284, heart.png [View same] [iqdb] [saucenao] [google]
5405582

>>5405556
your four reasons are exactly why pic related

>> No.5405693

>>5404510
If you are getting into particle physics i would strongly recommend c++ since it has a lot of programming to it, atleast if you have to process data.
Matlab is easy to work with especially with vectors, matrices and computer simmulations.
This is comming from another physics student

>> No.5405751

>>5404510
Physics = Mathematica.

You get so much as far as visualization etc. It is very fun software.

http://www.walkingrandomly.com/

>> No.5405763

>>5405414
>implying there's any performance penalty for just using C++ with just the C subset + new/delete/cout/cin/cerr
>implying custom data types (arbitrary precision int, extended precision floats, etc) that are overloaded to act just like the built in ones aren't worth the minor OO overhead
>implying anyone under 35 who bashes C++ isn't just a hipster

>> No.5405792

>>5405356
I always assumed big projects/libraries for supercomputers were mostly written in C++. Are you saying this isn't true?

>> No.5405808

>>5405763
As I said, you don't understand why people choose C when they abandon high level languages.

> performance penalty
I don't think 99% of the people who advocate C++ on /sci/ actually measure performance in the practical sense but only the dick-waiving sense.

> custom data types
C has these. OO is quite possible in C. It's just a little more tedious.

> bashing C++ = hipster
I'm over 35.

>> No.5405827

>>5405808
C is just as high level language as C++.

>>custom data types
>C has these.
never said it didn't

>> No.5405841

>>5405827
C and C++ aren't equivalent. Even restricting yourself to the so-called "C with classes" subset is not equivalent. Their syntax and semantics are both different. In practice C has a relatively stable ABI even though one isn't specified and in practice C++ doesn't have one at all and can't possibly have one if it isn't specified. And it won't get specified.

>> No.5405898

>>5405841
Most people don't need to fuck around with ABI details and it's nowhere common enough problem to swear off C++.

>Their syntax and semantics are both different
Porting C code into functional C++ code isn't that difficult and at worst you can always cheat and heavily abuse externs; porting Java to Java on another OS has given me FAR more problems...

>> No.5406592

bump

>> No.5406636

>>5405319
>>5405356


Octave is very useful for prototyping. You design and test your shit in octave and then build it in C, hadoop, or whathaveyou.

>> No.5406653

>>5405898
> most people don't need to fuck around with ABI details
anyone who wants to use a decent programming language does

>> No.5406826

>>5405792

Probably 50% of all code running at our site is coded in good-old-fortran.

Why? Because the language is so dumb it's: easy to code (you don't need fancy objects or thread management (you are using MPI anyway) if you are doing number crunching) and even simpler for the compiler to create FAST code.

Also Fortran and C compilers are MUCH more mature.
People with large C++ projects sometimes have to stick to a specific compiler release as never versions have bugs (or their code depends on bugs of the old compiler version)

C++ is ok for many use cases (we even have people running Java code...) but if you are coding for speed (= count cpu cycles) you'd rather use C or Fortran.