-
Notifications
You must be signed in to change notification settings - Fork 11
Developing Functions
All MATLAB utility functions are located within the Library/ directory in one of several subdirectories:
-
utility/contains general utility functions -
ssc2matlab/contains functions which extend the MATLAB interface of SSC -
databus2matlab/contains functions which provide a MATLAB interface to DataBus
If your new function belongs to a new category, you must first create a category subdirectory for it under Library/:
- Create the category subdirectory. Use a lowercase name for consistency with the other categories.
- Add the new subdirectory to your MATLAB path.
- Verify that the project installation script,
install.m, will detect and install the subdirectory when run. This should happen automatically. - Commit your changes (if you haven't already).
- If the category will be merged into an official version of the Campus Energy Modeling project, then also add the new subdirectory to the list at the top of this wiki page.
Once a category exists for your function, follow these steps to add the function to the project:
- Write and test your function. For assistance, see Function Basics in the MATLAB documentation.
- Document your function using the guidelines and template provided in Writing Documentation.
- Place the
.mscript which contains your function in the appropriate category subdirectory underLibrary/. - Commit your changes (if you haven't already).
- Consider also creating an automated test script for your new function.
Existing utility functions provide excellent examples for both code style and documentation.
If you modify an existing function, please update the function documentation as needed. If applicable, please also update any tests and demos which use the function.
Please document your function as described in Writing Documentation.
Once your function is included with an official release of the Campus Energy Modeling project, you should also update the wiki documentation:
- For new utility function categories, add a section and description to Utility Functions.
- For new utility functions, add an entry under the appropriate section of Utility Functions.
- For modified utility functions, update the function entry in Utility Functions as needed.