Skip to Main Content Skip to Search
File Exchange
MATLAB Newsgroup
Link Exchange
  Blogs  
 Contest 
MathWorks.com

Loren on the Art of MATLAB

March 4th, 2008

Release R2008a Available

The first 2008 semi-annual release of MathWorks products is now available, R2008a. Over the next few months, some of my blog articles will highlight new features.

Contents

Highlights of Highlights of New Features for MATLAB

Here's a very short list, in no particular order, of some of my favorite new MATLAB features in this release.

What Are Yours?

After perusing the release notes or using R2008a, I wonder what your favorite new features are. Let me know here.


Get the MATLAB code

Published with MATLAB® 7.6

24 Responses to “Release R2008a Available”

  1. Jiro Doke replied on :

    Hi Loren,
    Some of the ones you listed above are my favorites as well (OOP, configurations, UITABLE, data brushing). Here are couple of others:

    * Enhancements to code-folding (for various language constructs, and also cells!)
    * File and “Directory” Comparisons Tool - now the Comparison Tool works for comparing two directories. This will be very useful for managing my demos.
    * Enhancements to publish (nested cells, forced snapshot)

    jiro

  2. Will replied on :

    I think the onCleanup function might be helpful to get rid of waitbars that don’t get closed down when the program crashes. I’ve noticed that if I’m not paying attention while debugging that I’ll have a dozen waitbars lying around from various runs.

  3. Ken Orr replied on :

    You can now customize the Desktop and Editor toolbars and really make MATLAB fit your work flow.

    Checkout the documentation here.

    -Ken

  4. mansour replied on :

    Hello,
    I like the OOP which I looked at its capability for a long time but I didn’t convert my applications from a function type to OOP but with the new capability, I think it is the time that I start and convert my codes to OOP. I am wondering what is the benefit of having events when the user interface doesn’t support events ( am I wrong?) . As I know GUIE generated application uses a technique similar to events (callbacks) but its capability is very limited.

    Regards

  5. Loren replied on :

    Mansour-

    The OO features to support events. Take a look at this part of the documentation: http://www.mathworks.com/access/helpdesk/help/techdoc/matlab_oop/bqvggvt.html

    –Loren

  6. mansour replied on :

    Thanks.
    I did not see the example that shows how to use event for UI.

    OK I am off to do a lot of programming in OOP! I need to change all of my programs to OOP. A lot of work, but it worth it.

    Thanks to Mathworks team this nice feature.

    Mansour

    ps: I just found that I still has R2007B :(

  7. Oliver A. Chapman, P.E. replied on :

    I’ve spent some time reviewing the release notes & have some comments:

    Nice to see the clearvars function. The FRP seems to be well written. At first I didn’t like that it only had 4 examples for 8 syntax options. But, it doesn’t seem unreasonable after I’ve read it in detail.

    It looks like the Variable Editor will be nice.

  8. Loren replied on :

    Thanks, Oliver. It’s good to hear that some of the new the documentation is working well for you.

    –Loren

  9. naor replied on :

    Loren, I’m most excited about JIT acceleration for user classes. The most burning question is, of course, will this improve my current code, written in the @myClass style, or do I need to convert to the new myClass.m style?

  10. Loren replied on :

    Naor-

    I believe the JIT acceleration for user classes is for the new style classes.

    –Loren

  11. MIkhail Poda replied on :

    I think that new oop (handle classes) will revolutionize the way big Matlab applications are implemented. Since Version 7 we could emulate some oop features with nested functions and function handles. I have following questions:

    - is the new oop internal implementation based on/similiar to that of the nested functions?
    - will handle classes be garbage collected? It is a problem with nested function - once defined they reside in memory even if the workspace they were defined in no longer exist. –> Memory leaks
    - has the new oop the performance problem which plagued nested functions? Example http://mathforum.org/kb/message.jspa?messageID=6009303&tstart=0

  12. Perttu Ranta-aho replied on :

    New OO syntax is good. Your list was missing packages i.e. namespaces. Sad that 2007b does not support packages, new OO code works (at least up to some level) with 2007b, which makes translation smoother.

    So the next big thing should be real improvements on GUI programming, uitable is nice but…

  13. Loren replied on :

    Mikhail-

    The object system is separate from nested functions though they both rely on some of the same underpinnings.

    If a handle to a nested function exists, then the nested function workspace must be retained. If you have example code with nested functions that leaves a memory leak, please, please, please send it in to technical support:

    http://www.mathworks.com/support/service_request/login_servicerequests.html?targetURL=/support/service_requests/contact_support.do

    so we can look into it and fix it.

    –Loren

  14. Mikhail replied on :

    Sorry Loren, I amdit that my second allegation is wrong, I overlooked that the memory leaks problem is confined only to the naive/improper use of java object callbacks (inside the nested functions) for which the remedy is already known:

    http://mathforum.org/kb/message.jspa?messageID=5950839&tstart=0

  15. Dave Foti replied on :

    Mikhail,
    To your comments on performance of function handles and handle objects: internally, handle objects and nested function handles use the same memory management system. Handle objects (and nested function handles), get destroyed when no longer reachable from any MATLAB workspace. This is different from garbage collection in that it allows handle objects to have destructors that are called immediately when an object becomes unreachable as opposed to some later point. There is a performance penalty in that more time is spent every time a reference to a handle object goes out of scope (to make sure it didn’t become unreachable). We are continuously working on improving the algorithms for managing handles and these improvements may affect both nested function handles and handle objects.

  16. MIkhail Poda replied on :

    Dave,
    you write about improving garbage collection algorithms, Loren wrote few posts earlier about JIT acceleration. I wonder why reinvent the wheel? Why do not translate Matlab code into java bytecode like Groovy and Scala do and let JVM solve the problems you are struggling with? I understand that it would mean a radical change in the language philosophy.

    I dream about native access to swing. I am sure all java geeks would love Matlab axes object (although not being free)! And “Matlab corner” in the “Java Developer’s Jounal” would also rocket your sales!

  17. Mike N replied on :

    I got rather badly bitten by the inefficiencies of memory handling in nested functions (as mentioned by Mikhail in post 11). With small test data sets, my program worked well. With large data sets, run-time increased dramatically, even though I was not running out of memory. The profiler wasn’t much help, because the time didn’t seem to be accounted for anywhere.

    I would like to say that I think sharing of variables within nested functions is a really useful feature, and I suspect that this is only a problem when a relatively large number of workspaces are in existence simultaneously.

  18. Loren replied on :

    Mike-

    I think you are right. The memory hanging around is going to depend on usage, how large the workspaces are, and how many of them are. We are also continually looking for ways to be smarter on memory and we think there is some room for more efficiency for some uses of nested functions. Fixing those requires a lot of work at home that people are designing.

    –Loren

  19. Dave Foti replied on :

    Mikhail,
    The question of levaraging the JVM and bytecode is an interesting one that we do think about. However, we have to consider the impact of how MATLAB differs from Java. For example, MATLAB doesn’t use garbage collection (GC) so the JVM can’t solve the specific problem we are struggling with. We do have to worry about performance, but we don’t have to deal with the semantic problems created by GC. The GC reclaims memory by destroying objects when memory becomes scarse, but ignores all sorts of other resources. In Java, these other resources need to be handled by explicit destruction (typically through close or dispose methods). People are tempted to use finalizers as if they were destructors, but the semantics of finalizers have enormous complexity from running on a special thread to the potential to “resurrect” objects to the lack of a deterministic ordering.
    -Dave

  20. Brad Phelan replied on :

    Hi Dave,

    Lexical scoping is the answer to many of the other object lifecycle problems. It is my one pet peeve in Matlab, the lack of lexically scoped blocks ( anonymous multiline functions) and a yield and ensure keyword. Many problems would just go away.

    open(’/etc/passwd’, ‘r’ ) @(fid)
    … read(fid, 10);
    … function_with_error();
    end

    Implementation of open is

    function open(file, flags)
    try
    …fid = fopen(file, flags)
    …yield fid
    ensure
    …fclose(fid)
    end
    end

    Essentially the block becomes a transaction on the file handle. The file handle is generated and yielded to the block. If the block generates an exception the ensure keyword within the open function still closes the file handle whilst propagating the exception to a higher level.

    The user never has to worry about closing the file handle as it is done automatically for them at the end of the block.

  21. Marcel replied on :

    Dear Loren,

    I just started to use matlab r2008a. I really like the better support for object-orientation, but I do run into some strange problems. For instance, I defined the following graph class:

    classdef graph > g = graph([0 1 0;1 0 1;0 1 0])

    ans =

    0 1 0
    1 0 1
    0 1 0

    >> neighbours(g,1)

    ans =

    2
    4
    6
    8

    >> find(g(1,:) | g(:,1)’)

    ans =

    2

    >> neighbours(g,2)
    ??? Index exceeds matrix dimensions.

    Error in ==> graph>graph.neighbours at 26
    ne = find(obj(v,:) | obj(:,v)’);

    So the call to neighbours seems to lead to problems in indexing behaviour, or do I overlook something?

    Regards,

    Marcel

  22. Marcel replied on :

    Right, I pasted the class definition into the previous post but this doesn’t seem to be supported. The point is; I just subclass from double, define a constructor with contents: obj = obj@double(g) and a function neighbours(obj,v) with contents ne = find(obj(v,:) | obj(:,v)’);

    The above results are then obtained…

  23. Rod replied on :

    I am a long time Matlab user on FreeBSD OS, and for each new Matlab release I hope to see Matlab fully supported of FreeBSD.
    Since Matlab6.5 I cannot get Matlab working on FreeBSD through the Linux emulation.

  24. Loren replied on :

    Rod-

    You can find out information about platform support here .

    –Loren

Leave a Reply


Loren Shure works on design of the MATLAB language at The MathWorks. She writes here about once a week on MATLAB programming and related topics.

  • Loren: Timothee- Anonymous functions can only be a single (complicated) expression. You might be able to do what you...
  • Timothee: Is there a way to combine multiple commands in anonymous functions? ex1: fun=@(A)([V,D]=eig(A ); A*V-V*D)...
  • Loren: Here’s Cleve’s reply to Etienne: The crucial factor is the number and location of the nonzero...
  • Loren: Tristan- Nested functions can be slower in some cases currently. We know we have some opportunities to...
  • Tristan: Wow! I just tried with a global variable and it’s 5 times slower than with a argument! function...
  • Jon: Loren, I encountered this same problem and I attempted to find the answer by looking at the documentation for...
  • Tristan: “One thing that I have long wondered about is relative speed of nested functions relative to...
  • Etienne Non: Hi! I’m trying to understand why the Matlab function LU.m takes almost 20 times more time to...
  • Loren: Jonathan- The behavior you see is because the variable x has to come into inplaceTest and then a copy is made...
  • Jonathan: I am calling it from another function, but have just noticed a bit more odd behavior. Here is what...

These postings are the author's and don't necessarily represent the opinions of The MathWorks.

Related Topics