Abstract
The MATLAB® command line is suitable for checking simple calculations and exploring how individual functions work. However, for most tasks it is more efficient to write your code in script files. In this chapter you will learn how to create, edit and save script files, add descriptive text that automatically generates a documentation file for your script, split your code into manageable sections, use the MATLAB Editor to identify coding errors and use it to help debug code and determine how much each command in your code contributes to the overall run time. The chapter will cover writing scripts in both the standard editor and the Live Editor, a relatively recent feature of MATLAB that enables live scripts to be created which can include formatted text, images, equations and user-controlled input.
This is a preview of subscription content, log in via an institution.
Buying options
Tax calculation will be finalised at checkout
Purchases are for personal use only
Learn about institutional subscriptionsNotes
- 1.
Executing code refers to the process of ‘running’ the code either by calling it from the Command Window or from the MATLAB ‘EDITOR’ or ‘LIVE EDITOR’ menus on the toolstrip.
Author information
Authors and Affiliations
Rights and permissions
Copyright information
© 2019 Springer Nature Switzerland AG
About this chapter
Cite this chapter
Webb, C.R., Domijan, M. (2019). Writing Script Files. In: Introduction to MATLAB® for Biologists. Learning Materials in Biosciences. Springer, Cham. https://doi.org/10.1007/978-3-030-21337-4_4
Download citation
DOI: https://doi.org/10.1007/978-3-030-21337-4_4
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-030-21336-7
Online ISBN: 978-3-030-21337-4
eBook Packages: Biomedical and Life SciencesBiomedical and Life Sciences (R0)