Is it not suggested to use the same function name as a variable?
Show older comments
Hello, I have three questions:
1. Is it not suggested to use the same function name as a variable? For example, if I define a function func in one m file-func.m. Is it possible to use function in main file like func=func(parameters)? I got warned in matlab, and not sure whether it is prohibited.
2. Can I use same parameter in different m files. In one m file, I may use result and function from another m file. Should I define different parameters? Or it is fine to use same parameters, because they will not affect the ones in another m file?
3. How can I define universe parameters that can be used in all m files? It is tiring to include a universe parameter in each m file, and if it is possible that would be great! For example, all my m files will use information, say N, and I do not want to introduce N to each m file, can I define it in main function and make it known to all m files?
Thank you!
Accepted Answer
More Answers (0)
Categories
Find more on File Operations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!