I'm now learning a bit of MATLAB and I have two versions of it. Version 4.2c, that I use on my emulated Windows 3.11 and the lastest one, that I use on my Windows Vista.
Here is a screenshot of it:
MATLAB 4.2c On My Windows 3.11 http://img9.imageshack.us/img9/4042/matlabv4.png
Then I want to know:
What are the main differences?
Are there are any differences in the language itself?
Will new libraries work?
EDIT: Now that I see the screenshot, I realize you really are referring to MATLAB Version 4.2c (R7). I thought perhaps you were mistakenly referring to the MATLAB Compiler instead, since I didn't think anyone would still be using a version that's over 15 years old! The oldest version I've used was when I first started learning MATLAB in 1996 on Version 5.0 (R8)!
The basic matrix and vector operations probably haven't changed much since Version 4.2c, although there are some newer functions to manipulate matrix data in different ways, like ACCUMARRAY, BSXFUN, and ARRAYFUN to name a few. Virtually everything else has probably changed in some subtle or not-so-subtle way: the MATLAB Desktop and Editor, graphics and plotting tools, creating graphical user interfaces, etc.. You can also do object-oriented programming now using MATLAB classes.
Anyhow, for all MATLAB releases starting from the newest Version 7.9 (R2009b) and going all the way back to Version 7 (R14, 2004) you can find the release notes on The MathWorks website. These release notes highlight the new features and bug fixes added to each MATLAB version since the previous release. For example, in order to see the difference between Versions 7.6 and 7.9, you'd have to look through the release notes from 7.7, 7.8, and 7.9. If you really need release notes going farther back in time, you will probably have to contact the MathWorks directly.
P.S. I may actually still have my old notes from my first MATLAB course, which I'm tempted to dig out of storage and take a look at just to see what may have changed since then. ;)
what isn't different?
I have no idea how much new has been added since then. I remember first learning about MATLAB around then and turning my nose up at the program... my guess is that you would find all the basic operations the same, because I remember these things working:
vector & matrix manipulation
elementary functions
basic plotting (e.g. plot, subplot functions)
.m file syntax
There's all sorts of stuff nowadays, particularly the toolboxes, things like the integrated debugger (breakpoints!) and profiler, just-in-time compilation (for-loops are much quicker now), GUI development, object-oriented syntax, Simulink, etc. etc.
You'll just have to try it and see... I have found in the last 10 years that there has been very little backwards compatibility trouble with matlab. The only thing I can remember that was challenging was some of the corner cases changed with handle graphics between v6 and v7.
There are a huge number of differences since that time. New variable types (logical, sparse, cell arrays, uint(N), single, etc.), objects, anonymous and nested functions, gui tools, toolbox changes galore.
Having said that, I have code written in 1988 (20+ years) that still runs with essentially no change. (Maybe version 3.5 or so?) And I just tripped recently over a piece of code from that era that is still actively being used.
The MathWorks does make great efforts to continue backwards compatibility for all code. Only under a great deal of discussion do they break that rule.
Related
I am struggling with MATLAB installation. At the last step, it shows the following message:
However, I have the .net and gcc compilers on my system. It is odd that it also requires MATLAB compiler. Because it should be installed with the software itself automatically. I have never faced such problems when installing earlier versions of MATLAB.
You don't face a problem at all. The installation runs smoothly and MATLAB will work perfectly. Only if you want to translate MATLAB code to C code with the Matlab Coder toolbox, you require a C compiler (such as gcc or MinGW). This is obvious. Why should MATLAB ship a C compiler if there are plenty of open-source compilers (of which you maybe have a preference?) and there is no need for MATLAB (the main product) to run it?
With Simulink it is a bit less obvious but the argument is the same (why should MATLAB ship a C compiler?). Simulink is a model-simulation tool, calling a once-defined model over and over again at fixed (or dynamic) time steps. To speed up the calculation, it actually compiles the code first (note that MATLAB mainly uses a just-in-time-compiler). Those are .mex files, which is basically compiled C code (similar to a DLL). For this, it needs a C compiler and which brings us again back to the argument of why to ship one.
To make a long story short: Don't worry. Go ahead, this is not a problem and totally normal. As you said, you already have a C compiler installed (gcc), MATLAB will find it and you will probably not even note it if you start Simulink or the MATLAB Coder.
BTW, MATLAB always had required those compilers. Only the Java runtime is shipped with it since R2013-something because they had a major issue with the Java update back then and the tech support went nuts =P
I have built an standalone Matlab application. I was expecting it to be faster than running the application from the Matlab environent but it is indeed a bit slower (1.3 seg per iteration vs 1.5 seg per iteration)
I am not counting the init time required by MCR but the execution of my code.
Is that the expected performance or should I be obtaining a performance improvement?
I haven't found any settings on the deployment tool that could help to reduce execution time.
Thanks in advance
Applications built with MATLAB Compiler should execute at pretty much exactly the same speed as within MATLAB.
MATLAB Compiler does not convert your MATLAB code into machine code in the same way as a C compiler does for C. What it does is to archive and encrypt your MATLAB code (note, it properly encrypts it, not just pcodes it as a comment suggests), create a thin executable wrapper and package them together, possibly also with MATLAB Compiler Runtime (MCR). MCR is very similar to MATLAB itself, without a graphical user interface, and is freely redistibutable.
When you run the executable, it dearchives and decrypts your MATLAB code and runs it against the MCR. It should run exactly the same, both in terms of results and speed.
Very old versions of MATLAB Compiler (pre-version 4.0) worked in a different way, converting a subset of the MATLAB language into C code, and compiling this. This provided a potentially significant speed-up, but only a subset of the language was supported and results, unless you were careful, could sometimes be different. Similar functionality is now available in the separate MATLAB Coder product.
There are a few small things you can do to improve performance: for example, within deploytool you can specify which toolboxes your application uses. deploytool uses a dependency checker to package up all MATLAB functionality that it thinks your code might possibly depend on, but it can't always tell exactly, as the functions your code needs might change at runtime. It therefore errs on the side of caution and includes more than necessary. By specifying only the toolboxes you know to be necessary, you can speed things up a little (it also speeds up the build process quite a bit).
I need to implement a couple of algorithms in MATLAB(homework), however I want to use GNU Octave instead. But I'd like to turn off any octave extensions, and basically turn it into FOSS-version of MATLAB. What settings should I change? What command-line options should I provide when executing octave program?
PS: I am aware of --traditional command-line option, although it doesn't seem to do much.
PPS: Any suggestions are welcome. If following your advice requires, for example, rebuilding octave from source, let it be.
Aside using the --traditional option there's nothing you can do. Simply do not use the extra syntax that Octave offers. After all, Matlab syntax is a subset of the GNU Octave language, and it's up to you to use that subset only.
EDIT: It's not the answer you'd like but there's a good reason why that's an impossible task (by impossible, I mean very difficult. The only option is really to just fork Octave and change it until it's an exact clone. And you don't want to do it, trust me). Imagine the following very example. Octave has the functions 'rows' and 'columns' but Matlab does not. If you changed Octave so that these functions no longer exist, all other Octave functions that use them (I'm guessing a lot), will also stop working.
Others before you have successfully convinced their professors to accept homework written in Octave though, just make sure you at least try to write compatible code.
EDIT 2: I'll try to explain by comparing this situation with pianos (seems like a very good comparison). You can buy a piano with 85 or 88 keys. Now imagine that Matlab is a piano with 85 keys while Octave is a piano with 88 keys (if you want, also imagine that Matlab has 3 pedals while Octave only has 2 pedals). The only difference between the two pianos is that one has a slightly larger tonal range, i.e., it can play a few more tones (from the 3 extra keys). But when you play a C4 on a piano with 85 keys and a C4 on a piano with 88 keys, the sound is the same, they are the same note. The notes are the functions and keywords you have available. They are the same. A note in one piano is the same note on the other.
Now, if you are a composer writing music, you may want to take that in consideration. Just don't write any piece of music that requires those extra keys. The music will be the same in both types of pianos. If you have a piano with 88 keys, you will not chop off the 3 extra keys because you want it to be compatible with the 85 keys pianos. You simply don't play those keys. A piano with 88 keys is compatible with a piano with 85 keys, in the same way that Octave is compatible with Matlab.
If you want a guide to remind you that you can't use those extra keys, I'd guess you could put some red tape on them to remind you not to use them. Similarly, use Octave with a text editor that has different syntax highlight for Octave and Matlab so it will highlight incorrectly when you use syntax that is not part of Matlab. Aside that, there is nothing you can do (unless you count forking the Octave project, request Mathworks to implement them in Matlab or implementing them yourself. I don't mean this as rude sarcasm, just trying to be exhaustive).
For sake of completion, yes Octave has not implemented all Matlab things yet but it's moving that way as people develop it. It's not a static project (just take a look at the NEWS file for the development branch for example), things get implemented as the people who need them develop them. And some functions do behave differently but those are bugs you can report (and even fix since after all it's free and open source). Such incompatibilities are not there for the sake of annoying users. They are there because no one has reported or fixed them. Plus most of them are for incorrectly or undocumented Matlab features.
EDIT 3: you can also turn on the matlab incompatible warnings (which are off by default). Run warning ('on', 'Octave:matlab-incompatible'). You can leave this on your .octaverc file. To see more warnings look into warning_ids.
I guess it is better to use a GUI that does it for you. I personally use Xoctave
due to its support and Matlab like interface.
I am about to start a project in visual image-processing and have no had experience with Matlab, Aforge, OpenCV and was wondering if anyone had any experiences with these different software packages.
I was also wondering which of the three packages were most efficient I assume OpenCV but has anyone had any experience?
Thanks
Jamie.
The question you need to ask yourself is which is more important - your time or the computer's time. If your task is really simple, you may be able to code it up in MATLAB and have it work right off the bat. MATLAB is by far the easiest for development - a scripted language with built-in memory management, a huge array of provided functions, and a great interface for displaying and manipulating data while debugging.
On the other hand, MATLAB is at least an order of magnitude slower than compiled openCV code for many tasks. This is especially true if you use the intel performance primitives libraries.
If you know how to code in MATLAB, I would suggest writing and debugging your algorithms in that language, then porting them to c/c++ with openCV for speed. If there are only a couple of simple functions that you need to speed up, you can call c code from MATLAB, but it's hard to get this working right the first few times you try it, so you're probably better off just rewriting your finished code entirely in c/c++
First, please elaborate about your project's needs. It has the biggest impact on the choice, in addition to other factors - your general programming knowledge (If you haven't dealt with dot net but just with C++, AForge is not a good choice, for example).
Generally,
Both AForge and OpenCV has a built-in interface to .Net, and OpenCV also with C++, python, and more. Matlab might be more efficient, but if you don't have any experience with it - you should also learn its syntax. Take it into consideration.
Matlab probably has the largest variety of functions, but it is more complicated than the other projects. OpenCV and AForge themselves have some differences - see them described in this StackOverflow question/ answers.
I worked last year in two similar projects with cars on the highway. Afaik, Matlab allows to process only one picture frame at a time (surely you could elaborate an algorithm to compute a stream) but using Simulink you can process the stream directly.
On the other hand, i found AForge a lot friendlier and easier to use since you can easily adjust the processing parameters from a GUI (not so fast/easy) to do in Matlab/simulink.
I'd go for Aforge.Net. It's also fast enough if you're worrying about processing speed. (using 640x480)
If you are asking about using one of these in .net,easily you can get info by this:
1-matlab mostly used in simulation of projects not the End-prototype project; my numer : 30;
2-aforge (as I'v used in many project) if you do not need the circular process like capturing image, or recognition of something in images or ... you'll find it very good, cause it is easy to use but useful for single processes; my number : 50
3-opencv very good at speed and useful for circular processes, for example you can capture images from a webcam and Instantly cartoonize it without any delay, But not easy-to-use as aforge. I like it anyway cause of its speed and MANY functions it gives us mostly anything we need in programming; my number : 80
Dr.Taha - Tahasoft.net
I have a project that requires lots of image processing and wanted to add GPU support to speed things up.
I was wondering if i compiled my matlab into c++ shared library and called it from within OpenCL program, does that mean that the matlab code is going to be run on GPU?
My own (semi-educated) guess is that you are going to find this very difficult to do. But, others have trodden the same path. This paper might be a good place to start your research. And Googling turned up Accelereyes and a couple of references to items on the Mathworks File Exchange which you might want to follow up.
Everything in jacket is written in c/ c++ / cuda.
Infact we now have a beta version libjacket (http://www.accelereyes.com/downloadLibjacket) which can be used to extend not just matlab but other languages if you are willing.
#OSaad
Most of our functions are the fastest options out there. Be it in C or matlab.
The Parallel Computing Toolbox in the upcoming release R2010b (due September 1st) supports GPU processing for several functions. Unfortunately, it only supports CUDA (version 1.3 and later), so with an ATI graphics card, you're out of luck. However, you may just want to buy a dedicated GPU, anyway.
Typically, if you can write your Matlab code in a "vectorized" way, then the packages like AccelerEyes and Jacket have a reasonable chance of making things run on the GPU. You can verify this to some extent beforehand by checking whether Matlab itself is able to run on multiple cores on the CPU (these days Matlab will use multiple cores if things are parallelizable in an obvious way).
If that doesn't work, then you need to drop down to C/C++ via mex and then, from there, call OpenCL yourself. Mex is how Matlab talks to C code, so you write C code that is called by Matlab (and receives the matrices, etc), then initialises and calls OpenCL. This is more work, but may be your only route (and, even if the automated packages work to some extent, this approach can still give more speedups because you can be smarter about memory management, for example, if you know what your are doing).