How to create a custom function?
Mostra commenti meno recenti
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"
Risposta accettata
Più risposte (1)
per isakson
il 1 Mar 2014
0 voti
- See: Function Basics and
- give it an honest try
- if you run into problems then return here with specific questions
2 Commenti
Nicole Isbell
il 1 Mar 2014
per isakson
il 1 Mar 2014
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
Categorie
Scopri di più su Programming in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!