[ 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: 162 KB, 540x588, Screenshot_2015-07-12-20-53-38-1.png [View same] [iqdb] [saucenao] [google]
7388405 No.7388405 [Reply] [Original]

Hey Sci I'm going to study applied physics. What do you think of matlab. Is it hard? Where do you use it for? Wich books does Sci recomend

>> No.7388437

It's powerful and well accepting in academia but it's way too locked down and proprietary. Personally I hate what it stand for so I don't use it. Also the syntax makes me want to kill myself but I guess some people like it?

>> No.7388457

>>7388405
I would say that depending on where you go with applied physics, it might be more worth your time to learn Mathematica, but that's something you'll have to look into by yourself.
In general, Matlab is really useful for specific things and can help simplify really annoying computations. It truly isn't that difficult to learn as long if you have another basic compsci language down like Fortran, python, C++, etc. If it's your first language, it'll definitely take longer to master.

Also, although it has a lot of content, I doubt you'll need a textbook to learn Matlab. Just look up some basic syntax tutorials online.

>> No.7388741

>>7388437
>Also the syntax makes me want to kill myself
Matlab in one sentence.

>> No.7389220

The syntax sucks but I do physics (2nd year) and we use it sometimes in modelling. It's great for visualisation.

>> No.7389262

>>7388405
http://4chan-science.wikia.com/wiki/Programming_Textbook_Recommendations#Matlab

>> No.7389510

>>7389220
>>7388741
>>7388437
>syntax

Really? The syntax is easy as hell to to learn IMO.
Much simpler than most languages I have seen.

>> No.7389514

>>7388405
there's always GNU octave, or SciPy

There are open source alternatives to matlab that had similar functionality

>> No.7389522

>>7389510
I agree that the syntax is relatively easy. Having some understanding of matrix algebra helps, especially when vectorizing code

>> No.7389525
File: 217 KB, 460x450, 1358656958697.jpg [View same] [iqdb] [saucenao] [google]
7389525

>matlab, not even once

>> No.7389547

>>7388741
>>7388741
>>7388741
>>7388741
>>7388741

>> No.7390026

>>7388405
you shouldn't ask these sorts of questions on 4chan
bunch of idiots will hate on it
in reality, as long as speed is not a big concern (in which case you'd write in C or C++, even fortran) matlab is the best software out there. It's data visualization capabilities are great, it has all the special functions and relevant libraries you could possibly need etc.

also
>book
lol what, just look at tutorials and do examples
do you not know any programming what so ever?

>> No.7390029

>>7390026
>do you not know any programming what so ever?
even if so, worry not
if you are going to use code only for scientific computation, matlab is the simplest and overall the best way to learn it.

also your skills in matlab will translate somewhat to C C++ C# java

>> No.7390093

>>7388405
R

>> No.7390117

>>7388405
I think mathematica is much better suited for applied physics. But if you're going to code and control robots, matlab might be practical.

>> No.7390142

>>7390029
>also your skills in matlab will translate somewhat to C C++ C# java

So why not learn those languages instead? At least you can compile your program and you don't need to buy a bloated, fucking expensive piece of software to execute it.

>> No.7390144

>>7390142
because in some cases you have to use matlab, and it is far easier to use matlab
what sort of fuckin simulations is OP going to need to run that matlab will actually take more than a second to do what he needs

>> No.7390154

>>7390144

My point was that matlab is expensive and you can't use your code without a license. I didn't say it wasn't useful.

>> No.7390173

>>7388405
Its a good language once you learn to think in vectorized and high level operations, but before you learn that it is a pain in the ass. But vectorized algorithms and code are like really important to learn to understand to be able to use and understand most advanced modern algorithms today.

Also Octave is an open source alternative which is pretty much Matlab-compatible so the "locked in" argument doesn't hold water.

>> No.7390194

>>7390173

Stop acting like Octive is some plug and play software that anyone can use. You have to understand how to use Linux before you can use Octive.

>> No.7390197

>>7390142
It's not true though. Many people who see well written vectorized Matlab code who have coded mostly in lower level and sequential languages are just lost like anxious little kids looking for their parents in a marketplace.

>> No.7390203

>>7390194
Installing and using Linux today at a beginners level is not very hard at all. You have graphical interfaces for everything if you want to and very user friendly installers which can install graphical QT interfaces for Octave.

If you want to use a programming language like a pro though.., yes sorry then you'll need to learn how computers and operating systems really work.

>> No.7390214

>>7390203

>Installing and using Linux today at a beginners level is not very hard at all.

And yet next to nobody actually uses it. Hey bro check out my program, just install linux and install octive and gnuplot and then run it and tell me what you think. What, you don't know what linux is? well it's a real operating system that you should learn to use because real pros use it, you shouldn't complain since it's compatible with proprietary software that costs thousands and thousands of dollars.

>> No.7390219
File: 47 KB, 640x334, 1388529263163.jpg [View same] [iqdb] [saucenao] [google]
7390219

>>7388405
It's great in college cause it's pretty hand in hand with what your text books teach

Real world, I don't kno anyone who uses it.
As an engineer I use excel (not just making spreadsheets. You can use this thing to build mini programs that do your work for you)
My buddies prefer java or C+ of some variety for their little programs.
I just like excel cause it came free on my work computer. I'm a mechanical engineer so we only took one or two classes on programming. Most of what I kno is self taught tbh.

>> No.7390220

>>7390154
what the fuck
just pirate it lol

>> No.7390222

its painful

>> No.7390230

Matlab is just a fancy matrix calculator that lets you code like you would in Java or Python.

>> No.7390239

>>7390214
"Nobody uses it"? Exactly how ignorant are you? The vast majority of servers on the internet run Linux. Universities use Unix systems and have been doing for like 30 years. Anyone doing university studies get into contact with Unix at some point unless they drop out in like beginners math courses first semester.

Not knowing what Linux is. Really? It's not 1995 anymore. Not even knowing about Linux but still about to do scientific calculations. That is just... unbelievable.

>> No.7390288
File: 10 KB, 442x302, Untitled.png [View same] [iqdb] [saucenao] [google]
7390288

>>7390239

>1.52%

>> No.7390308

>>7390288
Irrelevant statistic. EVERYONE in academia uses linux.

>> No.7390317

>>7390288
And how many percent of people who browse the internet could be interested in doing scientific computing, do you think? You could probably calculate the percentage of people doing MSc or higher education in STEM field in different countries if you want to.

>> No.7390327

>>7390317
come the fuck on
there is no need for a non CS person to immediately learn linux
it is a pain in the ass to install programs, even
i have better things to do than to waste my evening fumbling with tar.gz files
fuck linux, I hate it

>> No.7390330

>>7390327
Well.. if you are going to study CS or EE or AP or any of the other on a masters / research level you gonna need to learn it cause it will be in your courses anyway.

And if you're a poor tech geek learning it in your spare time you won't afford windows licences anyway.

>> No.7390393

>>7390327
>fumbling with tar.gz files
Wait, THIS is why people get turned off of linux?

>> No.7390405

>>7390393
I struggled with basic utilities when I tried it out.
>>7390327
this guy >>7390308 is right.
Most of the people in my EE lab use Linux.

>> No.7390534

>>7390405
literally no one in my ee lab uses linux
literally no one where i interned used linux

>> No.7390537

>>7390393
to use you need to know... stuff
i dont need to know anything to use windows
everything just handles itself automatically

>> No.7390539

which softwares can only be used with linux?

>> No.7390599

>>7390539
Someone claimed Octave could only be used with Linux.

I'm not sure that's even true. But he made so many other ridiculous claims at the same time which were easier to disprove.

>> No.7390859

>>7390599
>Octave only on linux
can confirm as false

>> No.7390972

>>7390288
My math department's computers all run RedHat

>> No.7390975

>>7390327
Most programs are easier to install on ubuntu than on Windows

>> No.7390983

>>7390308
This just isn't true. Why are people trying to push this?

I have completed my undergrad degree and working on my PhD and nothing I do or have done has touched linux.

Linux is good for what it is, but people want easy and windows/windows applications are just easier to learn.

>> No.7391013

>>7390534
What's your lab do?
We were doing a lot of low level stuff for machine vision.
Most of our machines ran windows (we used a lot of MATLAB), but everyone (except pleb me) knew linux.
I can believe it about the internship though. That's not academia.

>> No.7391122

>>7391013
we programmed fpga's, microcontrollers using assembly
used ardiuno to control motors

I'm certain you could do those on linux just fine. but the point is. it just doesnt fuckin matter, and if at all possible, i'd rather not install targz and look at the whiteon black "you gotta know the magic words" command panel shit

>> No.7391126

>>7390983
which subject?

>> No.7391131

>>7390142

>buy

>> No.7391340

numpy package for python works great for my needs. Not quite as well developed as matlab, but still great for science.

>> No.7391667

>>7388437
>Personally I hate what it stand for so I don't use it.

You don't like the name so you don't use it? Holy fuck this board is autistic

>> No.7391683

that drawing on the cover just looks like my boner right now

>> No.7392410

>>7391683
it is actually the eigenfunction of a rectangular waveguide

>> No.7394106

>>7388405
>Is it hard?
as programming languages go, matlab is fairly simple. sure it has a whole heap of commands but a simple >help "name of command" will give you a pretty detailed explination of that command and examples on how to use it
>Where do you use it for?
I'm studying civil engineering and I mostly use matlab for processing info I get from all sorts of experiments (breaking and bending beams and whatnot)
basically, every time you can use excel, matlab does it much better (when you've gotten good at it)
>Wich books does Sci recomend?
my teacher told me I should buy "MATLAB: a practical introduction to programming and problem solving" by Attaway, so I did. but I mostly just used the help that comes in matlab
a few youtube videos should get you going on the right track and the rest should be pretty easy

>> No.7394583

>>7390220
this, I pirated matlab and maple for my studies

we get these shitty one year licenses from uni (for free) and I cba with that

>> No.7394817

just take a class on computing and you'll have matlab down easy

>> No.7395826

What do you guys think about Mathematica?
One should have MATLAB and Mathematica both, don't you think? CAS and numerical analysis both.
Or is it unnecessary?

>> No.7395965

>>7395826
Wolfram Alpha is basically SaaS Mathematica if you use it right.

>> No.7396363

>>7390026
Nope totally new in this world.

>> No.7396543

>>7390219
>Real world, I don't kno anyone who uses it.
>I'm a mechanical engineer

Well, that explains it.

>> No.7396640

why would you ever use matlab?

>> No.7396845

>>7388405
>>7388405
Matlab is babby-tier in terms of difficulty. You'll be writing reasonable programs after an afternoon of tinkering with the thing. There is also GNU Octave which, for basic stuff, is a near-100% free/libre substitute, so you can try for yourself (but be aware that Octave generally lacks some more advanced features and is about an order of magnitude slower).

But you should really learn NumPy + Fortran or C++ instead.

>> No.7396985

>>7388405

Matlab can be a really powerfull tool for a physicist, but for that, is really important for you to think in term of matrices calculus, matlab is meant to masterise matrices calculus.
This shit is serious if you just want to work with numerical data.

If you work on matlab using for loops and shit, just stop here.
I can reduce numerical simulation times from days and hours to minutes just by using matlab properly.

for example the sumation of all the elements of a 3D matrix (4x4x4) full of ones (so the result is 4*4*4*1=64) ;

a=ones(4,4,4);

tic()
somme=sum(sum(sum(a)))
toc()

tic()
somme=0;
for ii=1:4
for jj=1:4
for kk=1:4

somme=somme+a(ii,jj,kk);

endfor
endfor
endfor

somme
toc()

it return you :

>>>somme = 64
Elapsed time is 0.000163078 seconds.
somme = 64
Elapsed time is 0.00131893 seconds.

If you want to work on your data acquisition, or do purely numerical simulation (like a montecarlo simulation), matlab is the real MVP.
Other way just learn C ++ or mathematica.

I use matlab and octave daily, python could be interesting for you too, didn't tried it yet, but it seems to be able to do matrices calculus as matlab does.

>> No.7397216

>>7390093
R is great for stats, data wrangling and plotting. It's a shit-heap of a programming language though. Would probably recommend python instead.

>> No.7397228

>>7396543

Yes, real world and not academia fantasy land

>> No.7397335

>>7395965
>Wolfram Alpha
ok consider this:
computation time
offline mode

>> No.7397357

Just how complicated does torque get

>> No.7397389

>>7388405
Use Python.
95% of what you do with a language will be faster and easier in Python.

if you really need speed, you shouldn't be writing in a scripting language anyway. Write in C++ and use an optimized library and manually multithread your calculation (whatever it may be).

95% of what you will do in matlab can be done in Python instead with an MKL-optimized Numpy and Scipy and matplotlib.

most of matlab can be simulated with:

import numpy.linalg as lolfaggit

and basic loops.

>> No.7397472

>>7397389
Python has really shitty syntax though

It is okay if you already know a few languages but definitely don't learn it as your first or the syntax will force you into a lot of nasty habits.

>> No.7397490

>>7397472
shitty syntax? What on earth do you mean? Python 3 cleaned up a lot of the strange things.

>> No.7397513

I work in financial analytics and data science and I prefer mathematica

>> No.7397536

>>7397490
Significant spacing and indentation is probably the biggest thing wrong with it.

>> No.7397616

>>7396985
Python is slow, c++ or fortran are significantly faster.

With that being said, depends highly on your research group. Learning any programming language will generally transfer basic concepts through different languages. Most big scientific codes are c++ or fortran with parallel computing, at least with my experience in astrophysics. But learning good programming practices in one transfers to the other. And make sure to tailor the selection of language to the task.

>> No.7397708

>>7397536
>muh curly brackets

>>7397616
C++ is considerably faster.

But it depends on what you're doing. If you're doing data management or research, you may not have the time to invest in writing high quality C++ code, which is considerably more time-intesive than good python code, especially if you're doing lots of irregular data manipulation and need flexibility.

It's true, though, that for any one task, you can make C++ faster than python, but python allows you much better tools for working with csv files and other data easily.

And anything you really want to do parallel in C++, you can just throw into a dll and use ctypes to access it with python if you're doing really long FFT's or something.

>> No.7397735

My shitty community college wants us to know Maple. Is it actually any good?

>> No.7397994

>>7390308
Just because you're an outlier doesn't mean it's not true.

>> No.7398012

>>7397994
Sorry >>7390327
I meant this guy >>7390983

>> No.7398023

>>7390327
>CS major
>Can't run a simple program from the command line to install software

You probably shouldn't even be near a computer.

>> No.7398207
File: 47 KB, 300x300, 1428681616373.jpg [View same] [iqdb] [saucenao] [google]
[ERROR]

>>7398023

>be new to linux
>install crunchbang
>neat
>need wine for some windows' software
>wine runs the software fine, but the microphone is not working
>google for answers
>turns out I need the latest version of wine
>that version is like from 2008
>go to wine homepage
>they only offer the latest beta for some reason
>wtf
>they don't even include the commands to install it
>find instructions somewhere else
>install wine latest version
>try to run software
>doesn't work
>turns out I gotta uninstall the previous version of wine and install some other shit
>can't find instructions to install that other shit that I need
>nothing I try seems to work
>back to windows I go

Fuck that shit, I ain't got the time.

>> No.7398270

>>7397735

No, Fuck Maple. I'm convinced schools got suckered into buying a decade license. If you're stuck with it, fine. Just be prepared to switch post edu

>> No.7398374

It's great for numerical work. Execution time is slower than C++, but it's incomparably easier to prototype/debug/verify your algorithms in, which is a BIG FUCKING DEAL with any moderately complex computations.

I've got my eye on Julia as a faster and more powerful (and more free) language for this type of stuff, but I'm waiting until data visualization gets more convenient with it before I start using it for most of my numerical work.

>> No.7398413

>>7398207
>need wine for some windows' software

This is the part you do wrong.

>> No.7398455

>>7398374
I don't find the benchmark of Julia to be very intellectually honest. It actually puts me off from wanting to try it.

>> No.7398518

since my first semester as a mech e our school had us learn matlab. almost every class requires knowledge of matlab/simulink, and it's pretty heavily integrated into our core curriculum.

it's pretty cool shit since it's really forgiving to use, and most mech e's don't know/need to know how to use c+ or anything beyond basic data structures.

the way it handles matrix calcs and how you can simply almost everything to matrices is really nice

simulink is really good when it comes to controls as well

>> No.7398531

>>7398374
I always forget how easy it is to debug lines in matlab.
I don't think I've had an IDE like that in a while.

>> No.7398539

>>7398531
Why would you need to debug? It's not a compiling language. You get relevant errors and warnings from the interpreter.

>> No.7398547

>>7398539
>Why would you need to debug?
I don't understand the question. Is there any way of programming that has no need for debugging? Errors and warnings from the interpreter are a form of debugging, and, anyways, the majority of bugs that matter produce functioning programs that do the wrong thing.

>> No.7398553

>>7398547
>functioning programs that do the wrong thing

But then they aren't "functioning". Maybe you meant to say that they "compile without error" but do the wrong thing. Once again compilation...

Good debug tools are crucial when you're not sitting in the lap of an interpreter which keeps track of things for you. If you are, not as important.

>> No.7398651

>>7398531
it is just as easy as in python with pycharm or any number of interpreters.

>> No.7399020

>>7398553
You don't know what debugging means. Back to school.

>> No.7399077

>>7396985
endfor ?
thats not even matlab syntax ya dingus

>> No.7399246

>>7398553
>Maybe you meant to say that they "compile without error" but do the wrong thing
That's clearly what he means. I think the problem here is the exact definition of "debug" i.e whether or not it is a specific function employed during compiling, or whether anything that leads to a lack of bugs, like an interpreter, are classed as "debugging". A case of technical definitions against colloquial implications.

>> No.7399256

>>7396985
>Matlab can be a really powerfull tool for a physicist, but for that, is really important for you to think in term of matrices calculus
Unfortunately, most modern physics works with infinite dimensional matrices, which I assume Matlab can't work with.

>> No.7399311

>>7391667
>built by hitler
>still going to buy it off him and use it
Yeah sure, ideology has no place when purchasing/using a product
Completely detaching emotions/ideologies from what you do is pretty much the definition of autistic you fucking retard

>> No.7399542

>>7399256
its called discretization and quantization

>> No.7399704

>>7399256
>Unfortunately, most modern physics works with infinite dimensional matrices

LoL go back on your notebooks calculate analytical shit, i'm speaking about real science here, not theoretical non sense.

>> No.7399720

>>7397472
>Python has really shitty syntax though

agree

>> No.7399728

>>7399720

kill yourself