>> x=1520
x =
1520
>> x=1.52e3
x =
1520
>> x=15.2e2
x =
1520
>> x=15200e-1
x =
1520
>>
Thus 1.52e3 means 1.52 by 10 to the power 3.
Vectors (i.e. one-dimensional arrays) are set up as follows:
col2=[1; 2; 3; 4; 5; 6]: enter a column vector with entries 1,2,3,...
col3=[1 2 3 4 5 6]: enter a row vector with entries 1,2,3,...
xx=0 : 0.1 : 2.5: creates a vector with elements [0, 0.1,0.2, ..., 2.5].
More generally, two-dimensional arrays, or matrices, are entered as
>> a=[1 2;3 4]
a =
1 2
3 4
>> b =[ 5 6; 7 8]
b =
5 6
7 8
where elements in a given row are separated by spaces (or commas) and rows are separated by semi-colons.Alternatively use
>> b = [ 5 6
7 8]
b =
5 6
7 8
These matrices can be combined as follows:
>> c = [ a b]
c =
1 2 5 6
3 4 7 8
>> d = [a;b]
d =
1 2
3 4
5 6
7 8
>>