User-Defined Functions in Matlab
User-Defined Functions in Matlab
Jake Blanchard University of Wisconsin - Madison
Spring 2008
Matlab Functions
Matlab permits us to create our own functions
These are scripts that take in certain inputs and return a value or set of values
We will need these as we use built-in functions for problem solving
Format of Function Declaration
function [output arguments] =function_name(input arguments)
User-Defined Functions
Suppose we want to plot: sin(3*x)+sin(3.1*x)
Create user-defined function
function r=f(x) r=sin(3*x)+sin(3.1*x)
Save as f.m
User-Defined Functions (cont)
Now just call it:
x=0:0.1:50; y=f(x); plot(x,y)
................
................
In order to avoid copyright disputes, this page is only a partial summary.
To fulfill the demand for quickly locating and searching documents.
It is intelligent file search solution for home and business.
Related download
- a quick tutorial on matlab
- matlab commands and functions omicron chapter
- modelling simulation and control in matlab
- user defined functions in matlab
- solving odes in matlab mit
- matlab commands in numerical python numpy
- matlab tutorial on ordinary differential equation solver
- solving problems in dynamics and vibrations using matlab
- the delta sequence n
- latex in matlab auburn university
Related searches
- piecewise defined functions pdf
- user defined function matlab
- tableau user defined function
- programmer defined functions matlab
- text box in matlab figure
- user defined function in c
- write differential equation in matlab discrete
- piecewise defined functions worksheet with answers
- sql user defined function
- python user defined type
- built in functions in python
- user defined function in sql