Geoscience Reference
In-Depth Information
end
B
which yields
A =
0.8147
0.9058
0.1270
0.9134
0.6324
0.0975
0.2785
0.5469
0.9575
0.9649
B =
8
9
1
9
6
1
3
5
10
10
h e result is as expected. We can expand the experiment by using a nested
for
loop to create a 2D array
B
.
rng(0)
A = rand(10,3)
for i = 1 : 10
for j = 1 : 3
B(i,j) = round(10 * A(i,j));
end
end
B
which yields
A =
0.8147 0.1576 0.6557
0.9058 0.9706 0.0357
0.1270 0.9572 0.8491
0.9134 0.4854 0.9340
0.6324 0.8003 0.6787
0.0975 0.1419 0.7577
0.2785 0.4218 0.7431
0.5469 0.9157 0.3922
0.9575 0.7922 0.6555
0.9649 0.9595 0.1712