2.4. Constants and Variables

Constants refer to fixed values which do not change during the execution of a program. Constants can be of two types:

2.4.1. Numeric Constants

Numeric constants are classified into three types, that is integer constants, real constants and complex constants. However, MATLAB does not differentiate between integer and real constants during execution. Integer Constants/Numbers

Integer constants/numbers consist of a set of digits, 0 through 9, with an optional ‘−’ or ‘+’ sign. Some valid examples of integer constants are as follows:


Spaces, commas and non-digit characters are not allowed between digits. Some examples of invalid integer constants are as ...

Get MATLAB® and Its Applications in Engineering: [Based on MATLAB 7.5 (R2007b)] now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.