Enter your Sign on user name and password.

Forgot password?
Sign In | Subscribe
Start learning today, and be successful in your academic & professional career. Start Today!
Loading video...
This is a quick preview of the lesson. For full access, please Log In or Sign up.
For more information, please see full course syllabus of MATLAB
  • Discussion

  • Study Guides

  • Download Lecture Slides

  • Table of Contents

  • Related Books

Lecture Comments (3)

1 answer

Last reply by: Ferdinand Solis
Thu Jan 30, 2014 5:44 PM

Post by Professor Arash Vafanejad on January 27, 2014

are you sure you write the code as I wrote; I guess you might have a syntax error. In case you can not find it, please send all your codes to me s I can check them.

0 answers

Post by Ferdinand Solis on January 27, 2014


I did the Newton's approximation method example many times. After I input 15, I get this error message:

Error using inline/subsref (line 13)
Not enough inputs to inline function.

Could you kindly tell me where the problem lies? Thanks.

Function M-Files, Part 1

  • In this session and next two ones we are examining functions and M-files that you will find useful, when you are developing your own programs.
  • MATLAB enables you to create your own function M-files. A function M-file is similar to a script file in that it also has a .m extension. However, a function M-file differs from a script file in that a function M-file communicates with the MATLAB workspace only through specially designated inputand output arguments.
  • Functions are indispensable when it comes to breaking a problem down into manageable logical pieces.
  • Short mathematical functions may be written as one-line inline objects.

Function M-Files, Part 1

Lecture Slides are screen-captured images of important points in the lecture. Students can download and print out these lecture slide images to do practice problems as well as take notes while watching the lecture.

  • Intro 0:00
  • Type 0:21
    • Type Sin
    • Type Fzero
  • M-file Versus Script File 1:10
  • Inline Objects 1:54
    • Input Argument
  • Function M-file 6:01
    • Defining Function
    • Function Y
    • Relative Error
    • Creating Finite Steps
    • Display