Turning a script to a function

70 ビュー (過去 30 日間)
Ethan Labianca-Campbell
Ethan Labianca-Campbell 2018 年 8 月 23 日
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!
  2 件のコメント
theblueeyeswhitedragon
theblueeyeswhitedragon 2018 年 8 月 23 日
Ethan Labianca-Campbell
Ethan Labianca-Campbell 2018 年 8 月 23 日
Thanks!

サインインしてコメントする。

採用された回答

Steven Lord
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.
  1 件のコメント
Ethan Labianca-Campbell
Ethan Labianca-Campbell 2018 年 8 月 23 日
Thanks!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeDebugging and Analysis についてさらに検索

製品


リリース

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by