MATLAB: How to apply smart indenting to a sub-function in MATLAB 7.7 (R2008b)

MATLAB

I have created a MATLAB function which contains sub-functions. If I select all the text in the file or just the sub-functions and right click and select 'Smart Indent' from the context menu, smart indenting does not occur for the sub-functions.

Best Answer

To apply smart indent to a subfunction in MATLAB 7.7 (R2008b), click File->Preferences->Editor/Debugger->Language and select 'Indent all functions' under 'Function indenting format'.