Octave is a pretty good replacement for the majority of MATLAB commands. It is nice because it is quite close to a clone in that most of the code written for MATLAB will work with Octave (plus it's free!). That being said I've heard many good things about Python (with appropriate packages) from co-workers.
There is a free version of matlab called Octave. it is GNU http://www.gnu.org/software/octave/ It isn't as powerful as matlab, but it will do in a pinch.
If you are familiar with python yon can also use the numPy(http://numpy.scipy.org/) or Scipy(http://www.scipy.org/) You can also buy a version of matlab for intel OS-X, i think they are abou 100$ (canadian) for a student.
Hope that helps!
Are you looking for something that looks like a calculator, or something that does the same computations as a calculator?
If it's the latter, may I suggest Octave?
Won't cost you a thing, does everything any calculator can do and there are graphical front-ends to choose from.
GNU Octave is your best bet. It offers most of the functionality and almost exactly the same syntax as MATLAB. Some of the graphical elements aren't as refined, but it's a decent alternative.
A lot of answers have mentioned MATLAB, but I think it hasn't been mentioned that there's an open source software, Octave, that has very similar syntax and most of the normally required tools.
Being a still-developing open source software, it does have some limitations in comparison though (and a frequent complaint seems to be that it's about 4 times slower). So you might want to go the python+scipy+numpy way after all. Or you could look into the limitations of Octave and decide whether it's good enough for your needs.
I took an ME robotics course in college recently. We used Peter Corke's excellent book, Robotics, Vision and Control. It starts from the base mathematics and works up through coordinate frames, kinematics, dynamics, localization, nativation, and computer vision.
The book uses MATLAB for all programming examples. As a CS major, you may not be familiar with it, but it's an excellent language/environment for matrices (which is a majority of the mathematics required for robotics). As a student it's available for $99. Theres also an open source clone of the project, GNU Octave.
Couple of options:
1) See if your university has Matlab licenses for students. Often they have free Matlab for your time at university.
2) If not, download GNU Octave (the MinGW version is the easiest option if you're on Windows, though it can sometimes take a little work to get up and running)--as long as you're not planning on using any toolboxes in either (which, just starting out in Matlab, you won't), any syntax that will work in Matlab will work in Octave. (The other way is not true--so make sure you use Matlab-compatible syntax at all times). Thus, you can use Octave to run Matlab code and practice your Matlab skills.
Don't waste your money on a personal MATLAB license before you've even started lab work - GNU Octave is a free analysis package whose syntax is close enough to MATLAB's that most MATLAB programs can be easily ported to Octave. If you do join a lab that uses MATLAB then you'll certainly gain access to an academic license, which will in most cases allow you to install MATLAB on a personal machine so that you can use it at home.
Having said that, I personally recommend Python as an environment for data analysis. Like many other neuroscientists, I started out using MATLAB then switched to Python partway through my PhD. Python is a much more well thought-out programming language, and there are now Python modules available that cover pretty much all of MATLAB's functionality, as well as a huge number of other applications. The Anaconda Python distribution from Continuum Analytics is probably the easiest way for a beginner to get set up.
If you really need MATLAB emulation, use Octave: http://www.gnu.org/software/octave/. It's essentially designed to be a free version of MATLAB. It has virtually identical syntax, operations, etc. Getting it to work on a Windows machine can be a pain, though -- I used Cygwin, a unix emulator for Windows: http://www.cygwin.com/
Everyone in all of the labs at my university (both theoretical/computational and experimental) use matlab. I took a theory class and used matlab for everything for modelling everything from single compartment conductances to network dynamics. Psychophysics experiments widely use the psychophysics toolbox for matlab to program stimuli. I also use matlab for data analysis and statistics (calcium imaging and patch-clamp electrophysiology). The worst thing about matlab is the cost/availability. For this reason, you might want to use something like octave. I am a novice and spend far too much time writing simple programs to offer advice but I wish I would've started in high school.
R for biostats is still used by some but many programs are switching to python for genomics etc. (my roomate is a genomics person and prefers to use numpy when dealing with matrix manipulations).
You need a basic programming language.
I'm assuming a point cloud is a list of points described by their coordinates. Since pressure is fully determined by volume and temperature (for fixed n), you can easily generate a list of 3D points for a range of volumes and temperatures. For example (in Octave):
volumes = 1:10; temperatures = 0:10; n = 100; R = 8.3144621;
for V = volumes for T = temperatures p = n*R*T / V; printf('%f,%f,%f\n', V, T, p); end end
This yields:
1.000000,0.000000,0.000000 1.000000,1.000000,831.446210 1.000000,2.000000,1662.892420 ... 10.000000,8.000000,665.156968 10.000000,9.000000,748.301589 10.000000,10.000000,831.446210
This works analogously for other equations. I'm not a physicist so excuse the ridiculous example values.
Control Ph.D. candidate and (seemingly) career undergraduate TA here.
I would recommend looking for something on MIT open courseware (search for "control"). I also recommend installing Octave to give yourself a tool with which to learn and apply control concepts. I really like Ogata's Modern Control Engineering as well.
Find a course or book that teaches the concepts, but make sure to do the exercises. That's where you will learn how to apply this stuff, and studying control is kind of useless if you can't apply it.
Classical control is important to build a strong foundation, and most of that stuff was designed to be doable without computers (the theory is older than computers) which is neat. Eventually if you want to stick with it, move on to state space control and all of the super cool things you can do with it.
I guess you're referring to MATLAB! You should also take the time to get to know Octave, both as a "lightweight" and free, open-source version of MATLAB. After all, you won't qualify for student pricing on MATLAB forever :)
GNU Octave may also be suitable.
It's very close to MATLAB-compatible if you are careful, but doesn't hurt your wallet. However, in my experience, it's not as fast as MATLAB and doesn't have all of those extensive libraries (it does has some of its own).
Depends on what you want to do. When it comes down to it, MATLAB focuses on matrix/array manipulation. But it does have a ton of functionality that makes my life easier.
If the functionality you need is available in a python library like NumPy, then you're sorted. I use a lot of the control system toolbox - just found a Python library that looks like it'd do some but not all of what I need... I also use Simulink, MATLAB's visual programming environment - I think that may be trickier to replace.
Take a look at a few open source alternatives if you want to have a play - I haven't used any of these, just found them with a quick search.
I use MATLAB because it's available to me, and everyone I work with uses it. I could do the same thing with other tools, but this is what I know. Going back to the more general question of whether to spend time learning MATLAB, if it's CV-stuff you're looking at then have a play so you can claim familiarity, but it's not too hard to pick up quite quickly, so don't stress too much - particularly if you have assessed units to worry about!
There are some good primers on the mathworks site - run through the basics and you'll be able to pick the rest up through the 'help' and 'doc' functions.
The biggest thing for me is actually knowing what's available! I've spent more time than I care to admit replicating functionality that's already there. There are hundreds of 'toolboxes' - plugins that enhance functionality, cf libraries. Skim the features list just so you're familiar with what it can do.
TL;DR: If you don't have to, don't worry; but maybe skim the docs/have a play if it'll look good on your CV. There are many free alternatives that replicate basic and advanced functionality.
> It's very convenient to be able to do plotting and analysis from within the same environment
If I may mention, you can achieve the same symbiosis with GNU Octave. It uses Gnuplot for display, but you dont interact with gnuplot directly, but through Octaves plotting API, which is similar to matlab's API and is very convenient for interactive data exploration.
Octave does have booleans, but it calls them "logical values". See Logical Values in the Octave documentation. You can convert a logical value to a numeric value using a conversion function such as double. You can see this in use in ex2.m when computing the training accuracy: the comparison result gives a logical matrix, which is then coerced to a double matrix, over which the mean is computed:
fprintf('Train Accuracy: %f\n', mean(double(p == y)) * 100);
You can examine the type of an expression using the class function, like so:
octave-3.4.0:133> class(1 == 1) ans = logical octave-3.4.0:134> class(double(1 == 1)) ans = double
If the first executable line of a .m file is not a function definition, the file is a script file and all of the variables and functions in the file will be imported into the global namespace. See http://www.gnu.org/software/octave/doc/interpreter/Script-Files.html#Script-Files
If the first line defines a function, then any other functions in the file are "subfunctions" and only accessible from within that file. http://www.gnu.org/software/octave/doc/interpreter/Subfunctions.html#Subfunctions
If you are on a mac and not using Emacs, using Octave Mode to edit .m files and run Octave inside Emacs, I can't suggest it enough!
http://www.gnu.org/software/octave/doc/interpreter/Emacs-Octave-Support.html#Emacs-Octave-Support
It helps not to just read or watch about Matlab, but to actually practice using it. You can pick up a student version for $99.
https://www.mathworks.com/programs/nrd/buy-matlab-student.html
If that's too much, there's an open source version which is similar called Octave. Much of the syntax is pretty close (but not exact).
cool. turns out frame2im is missing as well though, but if I go to http://www.gnu.org/software/octave/missing.html to look into implementing it, it redirects to the already implemented function index http://octave.sourceforge.net/functions_by_alpha.php which times out. So I don't know whether I would be duplicating work.... sometimes things just aren't meant to happen. I'll leave the tab open and see if the page loads tomorrow
Even the Stanford ML class on coursera uses Octave, which is like an free/open source language designed to be 100% compatible with matlab source.
Edit: Using this as a sketch book now.
I too, love my mac. Octave is your friend. I'm EE, and see it used sparsely in a couple of departments, but for most of our purposes C will suffice without a $10,000 License.
Like most people have said here, MATLAB is really popular in computational, cognitive, developmental and systems neuroscience.
It is a good language to get started with, as it will give you the foundational blocks and most labs in said fields use it anyway.
If you don't have access to a copy of MATLAB via your institution and don't want to shell out some serious cash, you can get started with the GNU open source alternative: Octave.
If you've got both the money and the time, learn MATLAB. If you've got only time to spare, go with Octave. Otherwise, just use any sound editing software and take screenshots and crop off the unwanted parts.
One way to avoid timeout is to use persistent variables for C and sigma. Persistent variables keep their value between function calls (if the function source has not been modified). So in this case the dataset3Params function would look like:
function [C, sigma] = dataset3Params(X, y, Xval, yval) persistent C; persistent sigma; persistent hasRun; % used to check if the function ran before
if (isempty(hasRun)) % variables are empty if declared without definition hasRun = true; % original dataset3Params code here end
end
Bear in mind that the function has to be called at least once before submitting it.
You could try GNU Octave, a free Matlab alternative. It's not 100% compatible but a lot of stuff will work exactly as in Matlab. inv() and a lot of other matrix stuff is there, so the code Yuushi posted will work as-is.
Also, I don't remember much from a numerical methods class I took a long time ago, but matrix inversion is usually a poor approach which fails quickly as n grows. You may want to check LU decomposition or Gaussian Elimination or similar. Another advantage of not programming "manually" in C++: Matlab or Octave are smart about this and will choose an optimal method for you.
I'm not a mathematics major, but have you looked at Octave?
I have no idea if it fits your needs, but it may be worth looking into.
edit: forgot punctuation.
What kind of programs are you writing? Are you crunching numbers, or are you creating interactive programs to use in experiments? If it's the former, then learn MATLAB. For the latter, learn Python.
There's a free command line implementation of MATLAB called Octave that you can download and use if you don't have MATLAB installed at the moment.
Problem solved!
It's really quite powerful and very MATLAB compatible. Aside from MathWorks' specialized toolkits and SIMULINK, Octave would drop right in as a replacement.
If you don't do anything too funky in matlab there is also octave which is basically a free clone of Matlab. It can also interface with c,c++ libraries, so if you need to use a library from elsewhere you can.
We are using parts of Cleve Moler's book in an undergraduate numerical analysis course, specifically chapters 1, 2 and 4. I think it's a pretty good book. It offers interesting exercises and good explanations. You can see for yourself if you like it.
Personally I am not a fan of MATLAB though, being nonfree. Depending on the scope of the course you may be able to use free software such as GNU Octave, which I think would be a big plus for students.
Both are suited for different tasks as other people have pointed out. I think you should also know that there are open source alternatives like Octave, Sage and Scipy/Numpy . They don't quite have the user base as the big commercial packages but they handle quite a few tasks just as well.
The standard linear algebra programs are MATLAB (costly) or Octave (free). Octave is excellent, and you can often get it to do what you need done. In particular, if you have some "symbolic" entries like the above (as opposed to just numbers), then the symbolic package may be what you need. I have never used it before, but I think it might be just what the doctor ordered.
That said, if you have access to Mathematica or Maple (costly) or have the fortitude for Sage (http://www.sagemath.org/), then you are in good shape. These have symbolic smarts built in, and also have matrix manipulation capabilities.
No Matlab, no license problems: http://www.gnu.org/software/octave/
Of course your code will likely still not work, but now you can at least feel like a hipster freedom-loving hacker in the meantime.
(though in fact Dynare works pretty well with Octave and in Debian-based systems is even packaged in repos)
results on different saddle height on knee angle, speed and acceleration are in http://imgur.com/a/PFqXS
we used standard home video cameras connected to a pc on their highest shutter speed setting. only special equipment where direct current lamps to eliminate flickering. raw marker coordinate data was exported and evaluated in http://www.gnu.org/software/octave/
marker detection works well if you keep the contrast between markers and background/body high - white/reflective markers and black clothes/backdrop.
we had some older version installed on the lab pc which bugged out some time, but i did some extra work on my laptop with the most current download (0.8.15) which was stable and more accurate in marker detection.
i am studying sports equipment tech and did a lab with quite ok results. only thing special where direct current lamps to eliminate flickering, rest was standard home video equipment linked to a pc. keep the contrast between markers and body/background high - white/reflective markers, black clothes/backdrop and hide or put black tape over anything that might throw the auto-detection of the markers off course.
evaluation of different saddle heights on knee angle, speed and acceleration http://imgur.com/a/PFqXS
we exported the raw data of marker coordinates and did the evaluation in http://www.gnu.org/software/octave/ but kinovea also provides tools to measure distances and angles. in any case you have to keep a reference object of known lenght in the same plane as the markers.
Absolutely. It can take a bit more time, and might not be as polished, but it's free. I used Octave heavily when I was taking PDEs because I didn't want to run to the campus labs for Matlab.
On a similar and related note, Sage is an open source response to Mathematica/Maple, although not as powerful yet. It's built in Python. I use it quite a bit for algebra and discrete stuff. Probably not too useful for OP, though.
If you mean a hand-held calculator, then no, I rarely use those. When I need numerical calculations I tend to use Octave. If for some reason I feel nostalgic enough to use a hand-held calculator, I usually use something like this HP-15C emulator instead.
It seems like you're asking for a programming language/development environment to use. If so, I'm not sure if you'll get much help here.
You might try one of these: http://matplotlib.org/, http://www.gnu.org/software/octave/
> Where abouts does it tell you total time spent?
As far as I know it doesn't -- I had to add up the 28-or-so days using a calculator.
> That's impressive though.
It was just revision for me, seriously. Keep at it and you'll get there, I'm sure.
> I'm going to school for Mechanical Engineering
I could see MATLAB working well for that, as well as Simulink, its graphical counterpart. Both are often available for free through university programs. If not, there is the open source Octave, which is very similar. These are scripting languages heavily geared for numerical computation and simulation.
Some knowledge of languages like C, C++, Verilog, or VHDL may be useful if you work with robotics or medical devices, where embedded systems can readily appear. Being able to bridge the gap between mechanical and electrical certainly wouldn't hurt.
> how to go about finding a compiler for whichever language I choose
That primarily depends on your language and operating system. Keep in mind that some languages don't need a compiler, just something to run the script. Regardless, such information is rarely more than the "obvious" Google search and following instructions. And there's the ever-convenient list on Wikipedia. However you should do some research before you pick one; just because it exists doesn't mean you should use it.
I'm not sure, but can you try "axis equal"? Does that fix the issue?
I'm frequently on Octave IRC, so if you prefer to chat about it, we can do it there:
Well since no-one's mentioned it, Octave is a free-software clone of Matlab. I'm not an expert, but the only thing I know of that it lacks, is, somewhat less good graphing (it still does lots of good graphing), and Matlab's symbolic math.
It's a really good clone; the Stanford ml-class.org uses it (along with Matlab) as its official programming language.
There are companies out there who give support to open source stuff. It's probably cheaper to buy just the support as opposed to the software and the support.
And it's not like you can't get the information about who wrote stuff. Lots of open source software is supported and extended by companies who have the same needs, and it seems odd to think that big projects wouldn't do the QA stuff. It's not like people on the big projects are just banging rocks together :P
But management is management, and logic doesn't always apply.
There are companies out there who give support to open source stuff. It's probably cheaper to buy just the support as opposed to the software and the support.
And it's not like you can't get the information about who wrote stuff. Lots of open source software is supported and extended by companies who have the same needs, and it seems odd to think that big projects wouldn't do the QA stuff. It's not like people on the big projects are just banging rocks together :P
But management is management, and logic doesn't always apply.
Warning: not familiar with the US at all.
I would say MATLAB. (Though the use of MATLAB really depends on the university. Don't want to drop the cash for it? Octave is basically source-level compatible and Free.)
Civils sometimes do computer modelling too, you know, depending on the course. Plus it's always useful to know you can whip something up / graph something in Octave/Matlab.
And while we're on the topic of languages: Learn some LaTeX while you're at it. I know folks who submit assignments in LaTeX.
In Octave:
format long function y = f(x) y = sqrt(9/16 - x^2) endfunction quad("f",0.1285873720288,0.75) answer = 0.345820522291148
Chances are you'll end up using a language like Matlab for your initial experiments in simulation. If you have the time, check out a free alternative like Octave or Scilab and familiarize yourself with the syntax.
Honestly, I don't recommend starting off with a compiled computational language unless your professor explicitly tells you that's what he wants from you. Learning Fortran while trying to come to grips with the Monte Carlo method will probably be intractable at this stage.
Also, you may want to read up on the Ising model in 1d. It's probably one of the most important systems in condensed matter/crystallization and will no doubt get you started on the right foot with your prof.
Good luck!