Home Download Buy Blog Forum Support

Problem setting up automatic build system for Matlab

Problem setting up automatic build system for Matlab

Postby JesseBikman on Fri Aug 24, 2012 2:33 am

I'm trying to write a decent build script for Matlab in Sublime Text 2.

I've managed to get the build script to successfully run Matlab scripts, but, despite the documented methods for doing so, I can't get Sublime Text 2 to create automatic builds of .m files using the "selector" syntax. What's going on here?

Here is my build script:

Code: Select all
{

    "cmd": ["/Applications/MATLAB_R2012a.app/bin/matlab", "-nosplash", "<$file_name"],
   
    "selector": "source.m"

}



More info here in the bug section of my github page, where you can see what I and one other user has tried so far: https://github.com/jessebikman/Sublime-Text-2-build-Matlab-code/issues/1

Also, for what it's worth, this all started as a branch off of this Stack Overflow question, which I asked: http://stackoverflow.com/questions/11869586/creating-custom-build-system-for-matlab-through-sublime-text-2
JesseBikman
 
Posts: 2
Joined: Fri Aug 24, 2012 2:24 am
Location: Chapel Hill, NC, USA

Re: Problem setting up automatic build system for Matlab

Postby bizoo on Fri Aug 24, 2012 6:54 am

I think you're confusing the filename and the scopename.
selector need a scopename to work.

You can find the scopename by looking to your tmLanguage file, so here Matlab.tmLanguage.
Now at the end of the file you will find the most outer scopename that you have to use:
Code: Select all
   <key>scopeName</key>
   <string>source.matlab</string>

So if you replace
Code: Select all
"selector": "source.m"

with
Code: Select all
"selector": "source.matlab"

it must work properly.
bizoo
 
Posts: 886
Joined: Wed Dec 08, 2010 6:53 am
Location: Switzerland

Re: Problem setting up automatic build system for Matlab

Postby JesseBikman on Fri Aug 24, 2012 3:47 pm

That solved the problem I was having. Thank you so much for the clear advice!

Now this is probably Mathwork's problem, not Sublime's problem, but when I run my code and all of the figures are generated, suddenly all of my figures close and I get this barrage of warnings:

Code: Select all
>> {Warning: Objects of graph2d.lineseries class exist - not clearing this class
or any of its super-classes}
{Warning: Objects of graphics.datacursorbehavior class exist - not clearing this
class
or any of its super-classes}
{Warning: Objects of graphics.panbehavior class exist - not clearing this class
or any of its super-classes}
{Warning: Objects of graphics.zoombehavior class exist - not clearing this class
or any of its super-classes}
{Warning: Objects of graphics.rotate3dbehavior class exist - not clearing this
class
or any of its super-classes}
{Warning: Objects of graphics.ploteditbehavior class exist - not clearing this
class
or any of its super-classes}
{Warning: Objects of scribe.legend class exist - not clearing this class
or any of its super-classes}
[Finished in 14.6s]


Is that familiar?
JesseBikman
 
Posts: 2
Joined: Fri Aug 24, 2012 2:24 am
Location: Chapel Hill, NC, USA


Return to Plugin Development

Who is online

Users browsing this forum: Majestic-12 [Bot] and 11 guests