what are they different file?

hi there are two m.files,but what are they different ? ths u

 Accepted Answer

Stephen23
Stephen23 on 19 Apr 2017
Edited: Stephen23 on 19 Apr 2017
Some beginners think that they are the same, but they are not: the top one is a script, the bottom one is a function:
And in general, scripts are great for playing around, but are useless for doing any real work (i.e. any code that you actually want to be reliable and get results from):

More Answers (0)

Tags

Asked:

on 19 Apr 2017

Edited:

on 19 Apr 2017

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!