How to create a custom function?
古いコメントを表示
If you are given an equation and told to write a function that would solve the equation when a number is input.
ex.
y=(2/x)*t
x ranges from 0-30
and the input is a value for t.
The main problem is that when i try to use "function" MATLAB says that "function definitions are not permitted in this context"
採用された回答
その他の回答 (1 件)
per isakson
2014 年 3 月 1 日
0 投票
- See: Function Basics and
- give it an honest try
- if you run into problems then return here with specific questions
2 件のコメント
Nicole Isbell
2014 年 3 月 1 日
per isakson
2014 年 3 月 1 日
A function shall be defined (/typed) in a text file. The word function on the first line (may optionally be preceded by comments) and the word end (optionally) on the last line. See Create Functions in Files
カテゴリ
ヘルプ センター および File Exchange で Programming についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!