Matlab Utilities for Mac OS X


Matlab Language Module for BBEdit and TextWrangler

Matlab Language Module is a language module plug-in for BBEdit and TextWrangler. It provides basic syntax-higlighting and function menu instructions to BBEdit/Textwrangler. It does not currently support block folding.

Download

Download Matlab Language Module (Version 2.3)

Installation

Unarchive the module using the Finder. The module plug-in is called "Matlab.bblm". Quit BBEdit or TextWrangler if it is open, and place the module in "Applicaton Support/BBEdit/Language Modules" or "Applicaton Support/TextWrangler/Language Modules" folder under your Library folder. (If the folder "Language Modules" does not exist in these locations, simply create a folder of that name there.) You may need to remove the .m suffix mapping for Objective-C in the BBEdit Preferences under Languages to get the Matlab module to work properly. (See the Notes below.)

Source Code

If you want the source code, email me at ajmiller@psu.edu.

Notes

2012-08-24: On Mountain Lion compatibility from Tom Shannon at Rush University:

Under Mountain Lion (the new OS version) executable files won't run unless they are authored by a developer with an Apple Development ID. The code has to be signed or, under the default settings, the OS kicks it out and won't let it run. So BBEdit recognizes the plugin but can't load your executable file.

The quick fix for users is to go to the "Matlab" executable in the Matlab.bblm package (Matlab.bblm/Contents/MacOS/Matlab), right click on it and choose open, then tell the OS that its OK to run the executable. Note that you must right click. Double clicking does not work. After that, it will run fine with no intervention.
Thanks Tom

2012-03-06: A number of people have contacted me asking if the plugin still works in BBEdit 10. I have tried it and it does work for me. Things to check:

2008-08-01: UPDATE Version 2.3: I've added keywords: parfor, classdef, properties, events, methods.

2006-06-25: I've changed the archive format from sitx to zip for the above links. If you would rather use Stuffit Expander, you can get the version 2.2 as sitx here.

2006-02-11: I was able to test the universal binary version of the language module on an Intel-based iMac with Text Wrangler and it works fine.

2006-02-08: UPDATE The above link is updated to Version 2.2 of the Language module. I was informed that Matlab 7 supports block comments using the delmiters '%{' and '%}'. Version 2.2 of the language module supports the block comments, and they are colored the same as line comments. The delmiters must appear on lines containing the delimiter and nothing else but whitespace. Block comments may nest. For example:

%{ block commented text %}

is a valid matlab block comment. Also

%{ %{ commented text blah blah blah %} %code to be ignored b = a * x; %}

is a valid nested block comment. If any other characters appear on the lines containing the delmiters, the delimiters turn into ordinary line comment markers. Version 2.2 is a universal binary. Keep in mind that using block comments will make your code incompatible with older versions of Matlab. Block comments are not very necessary anyway since most text editors, including BBEdit/TextWrangler, can easily apply and remove line comments to ranges of text.

2006-01-13: UPDATE The above link now points to Version 2.1 of the Language module. The only change is that the plugin has now been built as a universal binary. I have not tested it on an Intel based Mac. Send me an email if you have any problems with it.

2005-09-12: UPDATE The above link now points to Version 2.0 of the Language module. This new version is a bundle built with Xcode and requires BBEdit 8.0 and higher or TextWrangler 2.0 and higher. You can get the previous version (1.0.2) of the plug-in here.

New in version 2.0:

2005-06-22: BBEdit 8.2.2 has fixed the syntax coloring for compiled language modules. The matlab module should work normally now.

2005-05-11: BBEdit 8.2.1 appears to have broken the syntax coloring in the matlab module. The function popup appears to be unaffected, and built in languages also appear to work normally. I have contacted BareBones and they are aware of the problem. The bug affects compiled language modules. I assume this will be fixed in the next update to BBEdit.

2004-08-30: The Matlab module should work with BBEdit 8.0. Users should be aware that language modules are now installed in BBEdit's ApplicationSupport folder located in the user's Library folder or in the global /Library folder. For example:
/Users/<your user name>/Library/ApplicationSupport/BBEdit/LanguageModules/
is where language modules should be installed.
Also there is new support for what Barebones calls "Codeless Language Modules" presumably for providing a simple way to add new languages using plist files. One could create a matlab module using plists, but there is not much flexibility for handling function definitions nor can the plist distinguish between string delimiters and the matlab transpose operator.

2004-03-29: UPDATE: Matlab Language Module versions 1.0.1 and 1.0.0 don't support Unicode and will not work with BBEdit 7.1.3 or higher. The above link has been updated to 1.0.2 which supports Unicode and will work in the new version of BBEdit. Sorry for any inconvenience.

2002-11-12: I've updated the matlab language module at the above link to version 1.0.1. This version fixes a small bug that caused incorrect syntax coloring of the transpose operator when following a decimal point. If you find any bugs in the module feel free to send me an email about it.


Old Stuff

CMD_Matlab is an applescript that launches Matlab 6.5 for Mac OS X command line mode. This is useful for Jaguar users since the Jaguar release of Mac OS X broke the graphical interface to Matlab 6.5. CMD_Matlab first starts the OroborOSX window manager and then launches matlab in the Terminal. This only works on Mac OS X 10.2. Source is included incase you need to change reference to OroborOSX.

Note: A Matlab patch was released back in mid October 2002 that fixes problems with Jaguar. Go to Mathworks for the updater.

2003-01-10: Mathworks has released a replacement script to make LaunchMATLAB work with Apple's X11. See http://www.mathworks.com/support/solutions/data/33869.shtml for details. (1/13/03 Mathworks appears to have removed this page) You'll need to make it executable and open the package contents of LaunchMATLAB and copy it there. Be sure to make a backup of the old script. Here's a stuffed copy of LaunchMATLAB with the replacement script in it. You'll need to put this in the bin folder in your Matlab installation folder for it to work.

2004-03-05: If you use Mac OS X 10.3 (Panther) or higher, you need to run Matlab 6.5.1 with Apple X11 1.0. The LaunchMATLAB app that comes with the 6.5.1 update from Mathworks launches X11 and not OroborOSX. I have not tested any of the above downloads with Panther.


[A. J. Miller] [ESM] [Grad Students] [PSU Engineering] [Penn State]



© Copyright 2002-2012 by Andrew J. Miller. All rights reserved.