Graphics Reference
In-Depth Information
If we now write:
>> v = 3 + 7
v =
10
The variable v is worth 10 from now on, as shown in the following calculation:
>> v ^ 4
ans =
10000
The variable names begin with a letter followed by any number of letters, digits or underscores, bearing in mind
that MATLAB uses only the first 31 characters of the name of the variable. Also, it is very important point out that
MATLAB is sensitive to capital letters and lowercase. Therefore, a variable with capital letters is different from the
same variable with lowercase.
A.2 Numbers
You can work with different types of numbers and numerical expressions, which cover the entire field of numbers:
integer, rational, real and complex numbers, and are used in arguments to functions in MATLAB.
Arithmetic operations in MATLAB are defined according to standard mathematical conventions. MATLAB is
an interactive program that allows you to perform a variety of mathematical operations. MATLAB assumes the usual
arithmetic operations of sum, difference, product, division and power, with the usual hierarchy between them:
x + y
Sum
x y
Difference
x * y or x y
Product
x/y
Division
x ^ y
Power
To add two numbers simply type the first number, type a plus sign (+) and the second number. It may include
spaces before and after the sign so that the input is easier to read.
>> 2 + 3
Ans =
5
 
Search WWH ::




Custom Search