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!