Skip to Main Content
UC Logo
Libraries | Ask the Libraries

MATLAB Resources

Introduction to MATLAB and MATLAB Scripting

Functions

  • Function is a set of reusable code which has a sequence of comments to perform an action
  • Function has

            a) Function name

            b) Input arguments

            c) Output variable(s)

  • After the basic functionality is finalized the function can be executed by the following method

            a) Calling it from another function

            b) Calling it directly from command prompt

Illustrations of MATLAB Functions

  • mean() - Calculates the average of given set of numbers
  • sqrt() - Square root of the given number
  • det() - Calculates the determinant of a given array
  • inv() - Inverse of a given matrix
  • sort() - Sorts a given set of numbers
  • abs() - Absolute value of given complex number

University of Cincinnati Libraries

PO Box 210033 Cincinnati, Ohio 45221-0033

Phone: 513-556-1424

Contact Us | Staff Directory

University of Cincinnati

Alerts | Clery and HEOA Notice | Notice of Non-Discrimination | eAccessibility Concern | Privacy Statement | Copyright Information

© 2019 University of Cincinnati