Skip to main content

Writing Script Files

  • Chapter
  • First Online:
  • 1981 Accesses

Part of the book series: Learning Materials in Biosciences ((LMB))

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

Chapter
USD   29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD   69.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD   89.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Learn about institutional subscriptions

Notes

  1. 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

Authors

Rights and permissions

Reprints and permissions

Copyright information

© 2019 Springer Nature Switzerland AG

About this chapter

Check for updates. Verify currency and authenticity via CrossMark

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

Publish with us

Policies and ethics