Why the function file SHOULD have the same name as the first function in the file?
Show older comments
"You can save your function:
- In a function file which contains only function definitions. The name of the file should match the name of the first function in the file.
- In a script file which contains commands and function definitions. Functions must be at the end of the file. Script files cannot have the same name as a function in the file. Functions are supported in scripts in R2016b or later.
My question is twofold:
- Why the function file SHOULD have the same name as the first function in the file?
- Script files cannot have the same name as a function in the file? Why? What will go wrong?
Accepted Answer
More Answers (0)
Categories
Find more on Install Products in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!