Basic Arithmetic Look at the following picture. As you can see, simple computations are very easy. Just type in exactly what you want computed and press enter. If no variables are used, the answer will automatically be assigned to the variable ans. This variable can be used later, but don't forget that it will automatically be overwritten when a new computation is done.
Variables are also easy to use.
Simply type a variable name, the equal sign, and then some value to be assigned. Other common mathematical functions are available such as square root , trigonometric functions, exponential functions, etc. Refer to the help window under the help menu for the syntax of these functions. Calculus Matlab provides an easy way to compute both derivatives and integrals. To perform symbolic differentiation or integration, you must first declare a symbolic variable.