|
Matlab Basics for Powersystem Lab - Functions |
|
|
|
|
Tuesday, 03 November 2009 06:34 |
|
Page 3 of 8 FUNCTIONS To make life easier, Matlab includes many standard functions. Each function is a block of code that accomplishes a specific task. Matlab contains all of the standard functions such as sin, cos, log, exp, sqrt, as well as many others. Commonly used constants such as pi, and i or j for the square root of -1, are also incorporated into Matlab.
sin(pi/4)
ans = 0.7071
To determine the usage of any function, type help [function name] at the Matlab command window. Matlab even allows you to write your own functions with the function command; follow the link to learn how to write your own functions and see a listing of the functions we created for this tutorial.
|
|
Last Updated on Tuesday, 03 November 2009 07:38 |