My pick this week is a tool that makes it easy to package your own toolboxes into a single installer file to distribute. For 12.5 years this file has served a great purpose.
Starting with MATLAB R2012b, we introduced Apps. Apps packaging allow you to take your user interface and package it into a single file. A dependency analysis is done and you can include any auxiliary files that might be necessary such as data. The generated app has version control and can be installed into another user's Apps tab. Apps, however, only have one entry point and are thus not good for toolbox packaging.
Now, beginning with R2014b, you can package your own toolbox from the MATLAB toolstrip and it will build a single install file like Norbert's makeinstall.
Let's look at the two approaches: here is a directory of a few of my utilities I'd like to package up.
currentdir = cd('myutils'); % navigate makeinstall % Build install cd(currentdir) % restore
Three files are generate in my directory:
I copied these to a new directory and ran install. It took me through some steps, including how to add it to path at startup, a few tips on what it does and how to use it. At the end it recommends running the following to see the contents:
Which reveals the H1 lines for my functions!
I'm impressed. In addition to this, there's also the Make Install Technology white paper that explains how this all works in great detail.
Now let's use the R2014b functionality.
I'll select the folder and it will grab all of the files and their dependencies. Then I can put in any other meta information, documentation example etc. that I might have:
This builds a single install file which I can give to anyone:
This can be installed into the custom toolboxes.
It's automatically added to the path so those utilities can be used anywhere. I do hazard a word of caution that this may make it easier to have shadowed files. For example: I now have three versions of those functions, which one is actually going to be called? If I make an update to one, how do I ensure it's the right one? which -all will be your friend here.
which -all FEX
C\Documents\MATLAB\FEX.m C\Documents\MATLAB\myutils\FEX.m % Shadowed C\Documents\MATLAB\Toolboxes\myutils\FEX.m % Shadowed
So thank you Norbert for being ahead of the curve and providing us with the make install technology as well as for maintaining it over the last decade.
댓글을 남기려면 링크 를 클릭하여 MathWorks 계정에 로그인하거나 계정을 새로 만드십시오.