tags:

views:

56

answers:

1

I have thousands of lines of MATLAB ranging over several scripts that I have commented and broken up into cells. I would now like to publish. I have some universal formatting that I would like to apply. I would also like to be able to publish each script independently. At the moment I have written all these formats into a file called 'Formats.m'. So at the start of every script it publishes with the word 'Format' at the top.

Is there a way I can call in the formatting file without seeing the name published in the final script?

A: 

publish has an option codeToEvaluate which might be what you're looking for here.

To publish foo, but run Format first, try this:

>> opts.codeToEvaluate = 'Formats; foo';
>> publish('foo',opts)

If you're working from the Editor, the same option is available as a publish configuration.

Matthew Simoneau

related questions