Functions
Users are encouraged to read through the following primer: Functions Primer
Examples | Tutorials | MATLAB programs |
---|---|---|
Overview of functions | ![]() |
N/A |
A function cylinder.m used to compute the area and volume of a cylinder, given radius and height. | ![]() |
cylinder.m cylindertest.m |
A function circuit.m used to compute the power, current, and total resistance of a circuit in series. | ![]() |
circuit.m circuittest.m |
Examples for the advanced user | Tutorials | MATLAB programs |
A function used to compute the trajectory of a projectile. Use of global variables is introduced. | ![]() |
projectiletrajectory.m trajectorytest.m |
A main program calls a function, which calls another function... | ![]() |
dispplot.m paravelocity.m |
A function within a for loop: to compute and plot the trajectories of a projectile for varying angles (theta). | ![]() |
projectiletrajectory.m trajectory_theta.m |