Skip to content
MathWorks

Self-Paced Online Courses

  • Self-Paced Content
  • MathWorks
  • MATLAB Help Center
  • Community
  • Learning
  • Get MATLAB MATLAB
  • Sign In
    • My Account
    • My Community Profile
    • Link License

    • Sign Out
  • Contact MathWorks Support
  • Visit mathworks.com
  • Online Courses
MathWorks MathWorks

Select a Web Site

Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .

  • (English)
  • (Deutsch)
  • (Français)
  • (简体中文)
  • (English)

You can also select a web site from the following list

How to Get Best Site Performance

Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.

Americas

  • América Latina (Español)
  • Canada (English)
  • United States (English)

Europe

  • Belgium (English)
  • Denmark (English)
  • Deutschland (Deutsch)
  • España (Español)
  • Finland (English)
  • France (Français)
  • Ireland (English)
  • Italia (Italiano)
  • Luxembourg (English)
  • Netherlands (English)
  • Norway (English)
  • Österreich (Deutsch)
  • Portugal (English)
  • Sweden (English)
  • Switzerland
    • Deutsch
    • English
    • Français
  • United Kingdom (English)

Asia Pacific

  • Australia (English)
  • India (English)
  • New Zealand (English)
  • 中国
    • 简体中文
    • English
  • 日本 (日本語)
  • 한국 (한국어)

Contact your local office

image for course Make Your Functions User-Friendly

Make Your Functions User-Friendly

Design and implement functions with clear interfaces, proper input validation, and helpful documentation to enhance usability and improve the overall user experience.

Course modules

Introduction

Get an overview of the course.

Lessons:
  • Course Overview

Store Function Inputs in the Form You Want

Use the arguments block to ensure function inputs are stored in the correct size and type.

Lessons:
  • Allow Flexibility Without Allowing Errors
  • Specify the Size and Type of Function Inputs
  • Summary

Validate Function Inputs

Use validation functions to ensure function inputs have the correct attributes.

Lessons:
  • Why Validate Inputs?
  • Add Input Validation
  • The Interaction Between Size, Type, and Validation Functions
  • Summary

Create Functions with Flexible Interfaces

Write functions that allow optional inputs and can behave differently according to the calling syntax used.

Lessons:
  • Optional Inputs and Default Values
  • Different Behaviors for Different Calling Syntaxes
  • Lists of Multiple Named Options
  • Summary

Conclusion and Next Steps

Learn next steps and give feedback on the course.

Lessons:
  • Additional Resources
  • Survey

Format:Self-paced

Language:English

Language

  • Hands-on exercises with automated feedback
  • Access to MATLAB through your web browser
  • Shareable progress report and course certificate

The How and Why of Writing Functions

Increase the flexibility of your code by writing custom functions.

  • Trust Center
  • Trademarks
  • Privacy Policy
  • Preventing Piracy
  • Application Status
  • Contact Us

© 1994-2025 The MathWorks, Inc.