Turning a script to a function
70 次查看(过去 30 天)
显示 更早的评论
Hi all.
I've built a code to read files and plot data points from each file onto a graph.
Instead of copy and pasting the script every time that I want to use it though, I'd rather turn the script into a file that can be used as a function...
e.g. if I wanted to use the script, type something like "Run('SCRIPT')" and have it compute that way.
Many thanks to those who answer!
采纳的回答
Steven Lord
2018-8-23
Here's a documentation page that explains the syntax you need to use as the first line of your function to describe your function's interface. Once you've written a function, you call it the same way you'd call any of the functions included in MATLAB like max, clc, disp, etc.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Debugging and Analysis 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!