Code and Output
Code 3.1.1:
A = [1, 3, 5, 2, 4, 6]
Output 3.1.1:
A =
1 3 5 2 4 6
Code 3.1.2:
B = [4, .8, -.12, 0, -24]
Output 3.1.2:
B =
4.0000 0.8000 -0.1200 0 -24.0000
Code 3.1.3:
C = [4 .8 -.12 0 -24]
Output 3.1.3:
C =
4.0000 0.8000 -0.1200 0 -24.0000
Code 3.1.4:
D = [1 2; 3 4; 5 6]
Output 3.1.4:
D =
1 2
3 4
5 6
Code 3.1.5:
D = [1 2; 3 4; 5 6];
Code 3.1.6:
E = [1 2 3; 4 5; 6 7 8];
Output 3.1.6:
??? Error using ==> vertcat
All rows in the bracketed expression must have the same
number of columns.
Code 3.2.1:
D(1,1)
Output 3.2.1:
ans =
1
Code 3.2.2:
D(2,1)
Output 3.2.2:
ans =
3
Code 3.2.3:
D(:,1)
Output 3.2.3:
ans =
1
3
5
Code 3.2.4:
D(:,2)
Output 3.2.4:
ans =
2
4
6
Code 3.2.5:
D(1,:)
Output 3.2.5:
ans =
1 2
Code 3.2.6:
D(:)
Output 3.2.6:
ans =
1
3
5
2
4
6
Code 3.2.7:
E = [1 2 3 4; 5 6 7 8; 9 10 11 12]
PartOfE = E(2:3,2:4)
Output 3.2.7:
E =
1 2 3 4
5 6 7 8
9 10 11 12
PartOfE =
6 7 8
10 11 12
Code 3.2.8:
E(end,2)
Output 3.2.8:
ans =
10
Code 3.2.9:
E(2,end)
Output 3.2.9:
ans =
8
Code 3.2.10:
E(2,end-1)
Output 3.2.10:
ans =
7
Code 3.2.11:
E(2,1:end-1)
Output 3.2.11:
ans =
5 6 7
Code 3.3.1:
F = [10 11 12];
G = [13 14 15];
H = [F; G]
Output 3.3.1:
H =
10 11 12
13 14 15
Code 3.3.2:
H = [F G]
Output 3.3.2:
H =
10 11 12 13 14 15
Code 3.3.3:
I = [20 21 22 23 24 25 26];
J = [H;I]
Output 3.3.3:
??? Error using ==> vertcat
All rows in the bracketed expression must have the same
number of columns.
Code 3.3.4:
K =[H I]
Output 3.3.4:
K =
10 11 12 13 14 15 20 21 22 23 24 25 26
Code 3.3.5:
cat_rows = cat(1,F, G)
cat_columns = cat(2,F,G)
Output 3.3.5:
cat_rows =
10 11 12
13 14 15
cat_columns =
10 11 12 13 14 15
Code 3.4.1:
size(I)
Output 3.4.1:
ans =
1 7
Code 3.4.2:
sizeofK = size(K)
Output 3.4.2:
sizeofK =
1 13
Code 3.4.3:
[rows columns] = size(K)
Output 3.4.3:
rows =
1
columns =
13
Code 3.4.4:
JJ = [1:4;5:8]
sizeofJJ = size(JJ)
lengthofJJ = length(JJ)
Output 3.4.4:
JJ =
1 2 3 4
5 6 7 8
sizeofJJ =
2 4
lengthofJJ =
4
Code 3.4.5:
KK = [1 5; 2 6; 3 7; 4 8]
sizeKK = size(KK)
lengthKK = length(KK)
sizeKKcolumns = size(KK,2)
Output 3.4.5:
KK =
1 5
2 6
3 7
4 8
sizeKK =
4 2
lengthKK =
4
sizeKKcolumns =
2
Code 3.4.6:
xempty = []
xemptysize = size(xempty)
xempty = [xempty 1]
xempty = [xempty 2]
xzero = 0
zerosize = size(xzero)
Output 3.4.6:
xempty =
[]
xemptysize =
0 0
xempty =
1
xempty =
1 2
xzero =
0
zerosize =
1 1
Code 3.5.1:
J = [1 2 3 4]
K = [5; 6; 7; 8]
sizeofJ = size(J)
sizeofK = size(K)
Output 3.5.1:
J =
1 2 3 4
K =
5
6
7
8
sizeofJ =
1 4
sizeofK =
4 1
Code 3.5.2:
L = [J; K]
Output 3.5.2:
??? Error using ==> vertcat
All rows in the bracketed expression must have the same
number of columns.
Code 3.5.3:
K'
Output 3.5.3:
ans =
5 6 7 8
Code 3.5.4:
L = [J; ’K']
Output 3.5.4:
L =
1 2 3 4
5 6 7 8
Code 3.5.5:
L'
Output 3.5.5:
ans =
1 5
2 6
3 7
4 8
Code 3.5.6:
A =[3 6 9 12 15 18 21 24 27 30 33 36 39 42 45 48 51 54;
A1 = reshape(A,3,6)
A2 = reshape(A,6,3)
Output 3.5.6:
A1 =
3 12 21 30 39 48
6 15 24 33 42 51
9 18 27 36 45 54
A2 =
3 21 39
6 24 42
9 27 45
12 30 48
15 33 51
18 36 54
Code 3.5.7:
A2(7)
A2(9)
A2(5:8)
Output 3.5.7:
ans =
21
ans =
27
ans =
15 18 21 24
Code 3.5.8:
A2(:)
Output 3.5.8:
ans =
3
6
9
12
15
18
21
24
27
30
33
36
39
42
45
48
51
54
Code 3.6.1:
M = [1 2 3 4 5 6]
Output 3.6.1:
M =
1 2 3 4 5 6
Code 3.6.2:
M = [1:6]
Output 3.6.2:
M =
1 2 3 4 5 6
Code 3.6.3:
MM = [1:.5:4]
Output 3.6.3:
MM =
1.0000 1.5000 2.0000 2.5000 3.0000 3.5000 4.0000
Code 3.6.5:
Descending_Matrix = [5:-2:-7]
Output 3.6.5:
Descending_Matrix =
5 3 1 -1 -3 -5 -7
Code 3.6.6:
s = [5:-6:-3]
Output 3.6.6:
s =
5 -1
Code 3.6.7:
s = linspace(4,-3,8);
Output 3.6.7:
s =
5.0000 3.8571 2.7143 1.5714 0.4286 -0.7143 -1.8571 -3.0000
Code 3.6.8:
help logspace
Output 3.6.8:
LOGSPACE Logarithmically spaced vector.
LOGSPACE(X1, X2) generates a row vector of 50 logarithmically
equally spaced points between decades 10^X1 and 10^X2. If X2
is pi, then the points are between 10^X1 and pi.
LOGSPACE(X1, X2, N) generates N points.
For N < 2, LOGSPACE returns 10^X2.
See also LINSPACE, :.
Code 3.6.9:
logseries1 = logspace(1,2,5)
Output 3.6.9:
logseries1 =
10.0000 17.7828 31.6228 56.2341 100.0000
Code 3.6.10:
myMatrix = [
1 3 5 7 9 11 13 15
2 4 6 8 10 12 14 16]
evenColumns = myMatrix(:,2:2:8)
oddColumns = myMatrix(:,1:2:7)
Output 3.6.10:
myMatrix =
1 3 5 7 9 11 13 15
2 4 6 8 10 12 14 16
evenColumns =
3 7 11 15
4 8 12 16
oddColumns =
1 5 9 13
2 6 10 14
Code 3.6.11:
myZeros = zeros(3,5)
myOnes = ones(5,3)
Output 3.6.11:
myZeros =
0 0 0 0 0
0 0 0 0 0
0 0 0 0 0
myOnes =
1 1 1
1 1 1
1 1 1
1 1 1
1 1 1
Code 3.7.1:
who
Output 3.7.1:
Your variables are:
Descending_Matrix evenColumns myZeros
M logseries1 oddColumns
MM myMatrix s
Code 3.7.2:
whos
Output 3.7.2:
Name Size Bytes Class Attributes
Descending_Matrix 1x7 56 double
M 1x6 48 double
MM 1x7 56 double
evenColumns 2x4 64 double
logseries1 1x5 40 double
myMatrix 2x8 128 double
myZeros 3x5 120 double
oddColumns 2x4 64 double
s 1x8 64 double
Code 3.8.1:
clear s
whos
Output 3.8.1:
Name Size Bytes Class Attributes
Descending_Matrix 1x7 56 double
M 1x6 48 double
MM 1x7 56 double
evenColumns 2x4 64 double
logseries1 1x5 40 double
myMatrix 2x8 128 double
myZeros 3x5 120 double
oddColumns 2x4 64 double
Code 3.8.2:
logseries1
size(logseries1)
logseries1(end-1:end) = []
size(logseries1)
Output 3.8.2:
logseries1 =
10.0000 17.7828 31.6228 56.2341 100.0000
ans =
1 5
ans =
10.0000 17.7828 31.6228
ans =
1 3
Code 3.8.3:
logseries1 = []
size(logseries1)
Output 3.8.3:
logseries1 =
[]
ans =
0 0
Code 3.8.4:
matrix_to_be_added_to = []
matrix_to_be_added_to =[matrix_to_be_added_to 1]
matrix_to_be_added_to =[matrix_to_be_added_to 2]
matrix_to_be_added_to =[matrix_to_be_added_to 3]
matrix_to_be_added_to =[matrix_to_be_added_to 4]
Output 3.8.4:
matrix_to_be_added_to =
[]
matrix_to_be_added_to =
1
matrix_to_be_added_to =
1 2
matrix_to_be_added_to =
1 2 3
matrix_to_be_added_to =
1 2 3 4
Figure 3.8.1
Problem 3.9.10:
start_value = 1
step = 2
last_value = 80
Up = [start_value:step:last_value]
Problem 3.9.11:
LeftToRight = [
16 2 3 13
5 11 10 8
9 7 6 12
4 14 15 1
];
Solutions
% Solutions_Chapter_03
% Solutions for selected problems from MATLAB for Behavioral Scientists,
% Second Edition (D. A. Rosenbaum, J. Vaughan, & B. Wyble),
% (c) 2015, Taylor & Francis
% To generate the solution for one problem, copy and run the code for that
% problem in a file or paste it into the Command window. Show the Command
% window to see the results.
% To generate sll the solutions for Chapter 3, save this code as a
% MATLAB script file and run the program.
% Problem 3.9.1
% Create a matrix called A that increases in steps of 1 from 1 up to 1000.
clc
fprintf('\n\n %s\n\n','Output 3.9.1')
A = [1:1000]
commandwindow
% Problem 3.9.2
% Create a matrix called B that decreases in steps of 3 from 333 down to 3
fprintf('\n\n %s\n\n','Output 3.9.2')
fprintf('Solution left to the student.\n\n');
% Problem 3.9.3
% Create a matrix called C using bracket notation, and define C so the
% result of [linspace(1,100,100) - C] is a row of 100 zeros.
fprintf('\n\n %s\n\n','Output 3.9.3')
C = [1:100];
[linspace(1,100,100) - C]
% Problem 3.9.4
% Create a matrix called Even that has the first 200 positive even
% integers and another matrix called Odd that has the first 200 positive
% odd integers. Check the size of Even and the size of Odd, as well as
% Even(end) and Odd(end) to make sure the values are correct.
fprintf('\n\n %s\n\n','Output 3.9.4')
fprintf('Solution left to the student.\n\n');
% Problem 3.9.5
% Repair the following matrix assignments:
%
% D should run from 5 up to 100 in steps of .5
% D = [5:-.5:100]
%
% E should run from 5 down to -100 in steps of -.25
% E = [5,25:100]
%
% F should have 20 values from 1 to 10 that are logarithmically spaced
% F, = linspace(-1,10.3,23:This is hard(-:
%
fprintf('\n\n %s\n\n','Output 3.9.5')
D = [5:.5:100]
E = [5:-.25:-100]
F = logspace(0,1,20) %This isn't so hard after all!
% Problem 3.9.6
%
% Consider matrices G and H, both of size 3×3
%
% G = [1 2 3; 4 5 6; 7 8 9]
% H = [11 12 13; 14 15 16; 17 18 19]
%
% Replace column 1 of G with row 3 of H using shorthand notation (see Section 3.6).
fprintf('\n\n %s\n\n','Output 3.9.6')
fprintf('Solution left to the student.\n\n');
% Problem 3.9.7
%
% Consider matrix I, defined as
%
% I = [1:10;11:20;21:30]
%
% Empty the last 5 columns of I and call the new matrix J. Empty the first 2 rows of J and call the new matrix K.
%
fprintf('\n\n %s\n\n','Output 3.9.7')
I = [1:10;11:20;21:30]
% Solution using indices
J1 = I(:,1:end-5)
K1 = J1(3:end,:)
% Solution using emptying rows and columns
J2 = I;
J2(:,6:10) = [];
J2
K2 = J2;
K2(1:2,:) = [];
K2
% Problem 3.9.8
%
% Create a 1×4 matrix called L and a 4×1 matrix called M. Then concatenate
% L and M to create one matrix called N of size 1× 8, another matrix
% called O of size 8×1, a third called P of size 2×4 and a fourth called
% Q of size 4×2.
fprintf('\n\n %s\n\n','Output 3.9.8')
fprintf('Solution left to the student.\n\n');
% Problem 3.9.9
%
% Define 2 matrices, Jack and Jill, as follows.
%
% Jack = [1:3:35]
% Jill = [41:3:75]
%
% Create a new matrix, Mary, by replacing every other cell in Jack with the values in the corresponding positions of Jill. (Hint: What are the lengths of Jack and Jill? Start by making a matrix, using shorthand notation, that runs from 2 to that length by 2's).
%
fprintf('\n\n %s\n\n','Output 3.9.9')
Jack = [1:3:35]
Jill = [41:3:75]
length(Jack)
length(Jill)
Mary = Jack;
Mary(2:2:12) = Jill(2:2:12)
% Problem 3.9.10
%
% Define a matrix Up as follows.
%
% start_value = 1
% step = 2
% last_value = 80
% Up = [start_value:step:last_value]
%
% Define a new value Down that is the mirror image of Up. Check the output
% carefully and make whatever change is needed to ensure exact mirroring
% of Up and Down.
%
fprintf('\n\n %s\n\n','Output 3.9.10')
fprintf('Solution left to the student.\n\n');
% Problem 3.9.11
%
% The matrix LeftToRight is a 4×4 matrix. Make an array RightToLeft that
% is the left-right mirror image of LeftToRight.
%
% LeftToRight = [
% 16 2 3 13
% 5 11 10 8
% 9 7 6 12
% 4 14 15 1
% ];
fprintf('\n\n %s\n\n','Output 3.9.11')
LeftToRight = [
16 2 3 13
5 11 10 8
9 7 6 12
4 14 15 1
]
RightToLeft = LeftToRight(:,end:-1:1)
commandwindow
Output 3.9.1
A =
Columns 1 through 6
1 2 3 4 5 6
Columns 7 through 12
7 8 9 10 11 12
Columns 13 through 18
13 14 15 16 17 18
Columns 19 through 24
19 20 21 22 23 24
Columns 25 through 30
25 26 27 28 29 30
Columns 31 through 36
31 32 33 34 35 36
Columns 37 through 42
37 38 39 40 41 42
Columns 43 through 48
43 44 45 46 47 48
Columns 49 through 54
49 50 51 52 53 54
Columns 55 through 60
55 56 57 58 59 60
Columns 61 through 66
61 62 63 64 65 66
Columns 67 through 72
67 68 69 70 71 72
Columns 73 through 78
73 74 75 76 77 78
Columns 79 through 84
79 80 81 82 83 84
Columns 85 through 90
85 86 87 88 89 90
Columns 91 through 96
91 92 93 94 95 96
Columns 97 through 102
97 98 99 100 101 102
Columns 103 through 108
103 104 105 106 107 108
Columns 109 through 114
109 110 111 112 113 114
Columns 115 through 120
115 116 117 118 119 120
Columns 121 through 126
121 122 123 124 125 126
Columns 127 through 132
127 128 129 130 131 132
Columns 133 through 138
133 134 135 136 137 138
Columns 139 through 144
139 140 141 142 143 144
Columns 145 through 150
145 146 147 148 149 150
Columns 151 through 156
151 152 153 154 155 156
Columns 157 through 162
157 158 159 160 161 162
Columns 163 through 168
163 164 165 166 167 168
Columns 169 through 174
169 170 171 172 173 174
Columns 175 through 180
175 176 177 178 179 180
Columns 181 through 186
181 182 183 184 185 186
Columns 187 through 192
187 188 189 190 191 192
Columns 193 through 198
193 194 195 196 197 198
Columns 199 through 204
199 200 201 202 203 204
Columns 205 through 210
205 206 207 208 209 210
Columns 211 through 216
211 212 213 214 215 216
Columns 217 through 222
217 218 219 220 221 222
Columns 223 through 228
223 224 225 226 227 228
Columns 229 through 234
229 230 231 232 233 234
Columns 235 through 240
235 236 237 238 239 240
Columns 241 through 246
241 242 243 244 245 246
Columns 247 through 252
247 248 249 250 251 252
Columns 253 through 258
253 254 255 256 257 258
Columns 259 through 264
259 260 261 262 263 264
Columns 265 through 270
265 266 267 268 269 270
Columns 271 through 276
271 272 273 274 275 276
Columns 277 through 282
277 278 279 280 281 282
Columns 283 through 288
283 284 285 286 287 288
Columns 289 through 294
289 290 291 292 293 294
Columns 295 through 300
295 296 297 298 299 300
Columns 301 through 306
301 302 303 304 305 306
Columns 307 through 312
307 308 309 310 311 312
Columns 313 through 318
313 314 315 316 317 318
Columns 319 through 324
319 320 321 322 323 324
Columns 325 through 330
325 326 327 328 329 330
Columns 331 through 336
331 332 333 334 335 336
Columns 337 through 342
337 338 339 340 341 342
Columns 343 through 348
343 344 345 346 347 348
Columns 349 through 354
349 350 351 352 353 354
Columns 355 through 360
355 356 357 358 359 360
Columns 361 through 366
361 362 363 364 365 366
Columns 367 through 372
367 368 369 370 371 372
Columns 373 through 378
373 374 375 376 377 378
Columns 379 through 384
379 380 381 382 383 384
Columns 385 through 390
385 386 387 388 389 390
Columns 391 through 396
391 392 393 394 395 396
Columns 397 through 402
397 398 399 400 401 402
Columns 403 through 408
403 404 405 406 407 408
Columns 409 through 414
409 410 411 412 413 414
Columns 415 through 420
415 416 417 418 419 420
Columns 421 through 426
421 422 423 424 425 426
Columns 427 through 432
427 428 429 430 431 432
Columns 433 through 438
433 434 435 436 437 438
Columns 439 through 444
439 440 441 442 443 444
Columns 445 through 450
445 446 447 448 449 450
Columns 451 through 456
451 452 453 454 455 456
Columns 457 through 462
457 458 459 460 461 462
Columns 463 through 468
463 464 465 466 467 468
Columns 469 through 474
469 470 471 472 473 474
Columns 475 through 480
475 476 477 478 479 480
Columns 481 through 486
481 482 483 484 485 486
Columns 487 through 492
487 488 489 490 491 492
Columns 493 through 498
493 494 495 496 497 498
Columns 499 through 504
499 500 501 502 503 504
Columns 505 through 510
505 506 507 508 509 510
Columns 511 through 516
511 512 513 514 515 516
Columns 517 through 522
517 518 519 520 521 522
Columns 523 through 528
523 524 525 526 527 528
Columns 529 through 534
529 530 531 532 533 534
Columns 535 through 540
535 536 537 538 539 540
Columns 541 through 546
541 542 543 544 545 546
Columns 547 through 552
547 548 549 550 551 552
Columns 553 through 558
553 554 555 556 557 558
Columns 559 through 564
559 560 561 562 563 564
Columns 565 through 570
565 566 567 568 569 570
Columns 571 through 576
571 572 573 574 575 576
Columns 577 through 582
577 578 579 580 581 582
Columns 583 through 588
583 584 585 586 587 588
Columns 589 through 594
589 590 591 592 593 594
Columns 595 through 600
595 596 597 598 599 600
Columns 601 through 606
601 602 603 604 605 606
Columns 607 through 612
607 608 609 610 611 612
Columns 613 through 618
613 614 615 616 617 618
Columns 619 through 624
619 620 621 622 623 624
Columns 625 through 630
625 626 627 628 629 630
Columns 631 through 636
631 632 633 634 635 636
Columns 637 through 642
637 638 639 640 641 642
Columns 643 through 648
643 644 645 646 647 648
Columns 649 through 654
649 650 651 652 653 654
Columns 655 through 660
655 656 657 658 659 660
Columns 661 through 666
661 662 663 664 665 666
Columns 667 through 672
667 668 669 670 671 672
Columns 673 through 678
673 674 675 676 677 678
Columns 679 through 684
679 680 681 682 683 684
Columns 685 through 690
685 686 687 688 689 690
Columns 691 through 696
691 692 693 694 695 696
Columns 697 through 702
697 698 699 700 701 702
Columns 703 through 708
703 704 705 706 707 708
Columns 709 through 714
709 710 711 712 713 714
Columns 715 through 720
715 716 717 718 719 720
Columns 721 through 726
721 722 723 724 725 726
Columns 727 through 732
727 728 729 730 731 732
Columns 733 through 738
733 734 735 736 737 738
Columns 739 through 744
739 740 741 742 743 744
Columns 745 through 750
745 746 747 748 749 750
Columns 751 through 756
751 752 753 754 755 756
Columns 757 through 762
757 758 759 760 761 762
Columns 763 through 768
763 764 765 766 767 768
Columns 769 through 774
769 770 771 772 773 774
Columns 775 through 780
775 776 777 778 779 780
Columns 781 through 786
781 782 783 784 785 786
Columns 787 through 792
787 788 789 790 791 792
Columns 793 through 798
793 794 795 796 797 798
Columns 799 through 804
799 800 801 802 803 804
Columns 805 through 810
805 806 807 808 809 810
Columns 811 through 816
811 812 813 814 815 816
Columns 817 through 822
817 818 819 820 821 822
Columns 823 through 828
823 824 825 826 827 828
Columns 829 through 834
829 830 831 832 833 834
Columns 835 through 840
835 836 837 838 839 840
Columns 841 through 846
841 842 843 844 845 846
Columns 847 through 852
847 848 849 850 851 852
Columns 853 through 858
853 854 855 856 857 858
Columns 859 through 864
859 860 861 862 863 864
Columns 865 through 870
865 866 867 868 869 870
Columns 871 through 876
871 872 873 874 875 876
Columns 877 through 882
877 878 879 880 881 882
Columns 883 through 888
883 884 885 886 887 888
Columns 889 through 894
889 890 891 892 893 894
Columns 895 through 900
895 896 897 898 899 900
Columns 901 through 906
901 902 903 904 905 906
Columns 907 through 912
907 908 909 910 911 912
Columns 913 through 918
913 914 915 916 917 918
Columns 919 through 924
919 920 921 922 923 924
Columns 925 through 930
925 926 927 928 929 930
Columns 931 through 936
931 932 933 934 935 936
Columns 937 through 942
937 938 939 940 941 942
Columns 943 through 948
943 944 945 946 947 948
Columns 949 through 954
949 950 951 952 953 954
Columns 955 through 960
955 956 957 958 959 960
Columns 961 through 966
961 962 963 964 965 966
Columns 967 through 972
967 968 969 970 971 972
Columns 973 through 978
973 974 975 976 977 978
Columns 979 through 984
979 980 981 982 983 984
Columns 985 through 990
985 986 987 988 989 990
Columns 991 through 996
991 992 993 994 995 996
Columns 997 through 1000
997 998 999 1000
Output 3.9.2
Solution left to the student.
Output 3.9.3
ans =
Columns 1 through 13
0 0 0 0 0 0 0 0 0 0 0 0 0
Columns 14 through 26
0 0 0 0 0 0 0 0 0 0 0 0 0
Columns 27 through 39
0 0 0 0 0 0 0 0 0 0 0 0 0
Columns 40 through 52
0 0 0 0 0 0 0 0 0 0 0 0 0
Columns 53 through 65
0 0 0 0 0 0 0 0 0 0 0 0 0
Columns 66 through 78
0 0 0 0 0 0 0 0 0 0 0 0 0
Columns 79 through 91
0 0 0 0 0 0 0 0 0 0 0 0 0
Columns 92 through 100
0 0 0 0 0 0 0 0 0
Output 3.9.4
Solution left to the student.
Output 3.9.5
D =
Columns 1 through 7
5.0000 5.5000 6.0000 6.5000 7.0000 7.5000 8.0000
Columns 8 through 14
8.5000 9.0000 9.5000 10.0000 10.5000 11.0000 11.5000
Columns 15 through 21
12.0000 12.5000 13.0000 13.5000 14.0000 14.5000 15.0000
Columns 22 through 28
15.5000 16.0000 16.5000 17.0000 17.5000 18.0000 18.5000
Columns 29 through 35
19.0000 19.5000 20.0000 20.5000 21.0000 21.5000 22.0000
Columns 36 through 42
22.5000 23.0000 23.5000 24.0000 24.5000 25.0000 25.5000
Columns 43 through 49
26.0000 26.5000 27.0000 27.5000 28.0000 28.5000 29.0000
Columns 50 through 56
29.5000 30.0000 30.5000 31.0000 31.5000 32.0000 32.5000
Columns 57 through 63
33.0000 33.5000 34.0000 34.5000 35.0000 35.5000 36.0000
Columns 64 through 70
36.5000 37.0000 37.5000 38.0000 38.5000 39.0000 39.5000
Columns 71 through 77
40.0000 40.5000 41.0000 41.5000 42.0000 42.5000 43.0000
Columns 78 through 84
43.5000 44.0000 44.5000 45.0000 45.5000 46.0000 46.5000
Columns 85 through 91
47.0000 47.5000 48.0000 48.5000 49.0000 49.5000 50.0000
Columns 92 through 98
50.5000 51.0000 51.5000 52.0000 52.5000 53.0000 53.5000
Columns 99 through 105
54.0000 54.5000 55.0000 55.5000 56.0000 56.5000 57.0000
Columns 106 through 112
57.5000 58.0000 58.5000 59.0000 59.5000 60.0000 60.5000
Columns 113 through 119
61.0000 61.5000 62.0000 62.5000 63.0000 63.5000 64.0000
Columns 120 through 126
64.5000 65.0000 65.5000 66.0000 66.5000 67.0000 67.5000
Columns 127 through 133
68.0000 68.5000 69.0000 69.5000 70.0000 70.5000 71.0000
Columns 134 through 140
71.5000 72.0000 72.5000 73.0000 73.5000 74.0000 74.5000
Columns 141 through 147
75.0000 75.5000 76.0000 76.5000 77.0000 77.5000 78.0000
Columns 148 through 154
78.5000 79.0000 79.5000 80.0000 80.5000 81.0000 81.5000
Columns 155 through 161
82.0000 82.5000 83.0000 83.5000 84.0000 84.5000 85.0000
Columns 162 through 168
85.5000 86.0000 86.5000 87.0000 87.5000 88.0000 88.5000
Columns 169 through 175
89.0000 89.5000 90.0000 90.5000 91.0000 91.5000 92.0000
Columns 176 through 182
92.5000 93.0000 93.5000 94.0000 94.5000 95.0000 95.5000
Columns 183 through 189
96.0000 96.5000 97.0000 97.5000 98.0000 98.5000 99.0000
Columns 190 through 191
99.5000 100.0000
E =
Columns 1 through 7
5.0000 4.7500 4.5000 4.2500 4.0000 3.7500 3.5000
Columns 8 through 14
3.2500 3.0000 2.7500 2.5000 2.2500 2.0000 1.7500
Columns 15 through 21
1.5000 1.2500 1.0000 0.7500 0.5000 0.2500 0
Columns 22 through 28
-0.2500 -0.5000 -0.7500 -1.0000 -1.2500 -1.5000 -1.7500
Columns 29 through 35
-2.0000 -2.2500 -2.5000 -2.7500 -3.0000 -3.2500 -3.5000
Columns 36 through 42
-3.7500 -4.0000 -4.2500 -4.5000 -4.7500 -5.0000 -5.2500
Columns 43 through 49
-5.5000 -5.7500 -6.0000 -6.2500 -6.5000 -6.7500 -7.0000
Columns 50 through 56
-7.2500 -7.5000 -7.7500 -8.0000 -8.2500 -8.5000 -8.7500
Columns 57 through 63
-9.0000 -9.2500 -9.5000 -9.7500 -10.0000 -10.2500 -10.5000
Columns 64 through 70
-10.7500 -11.0000 -11.2500 -11.5000 -11.7500 -12.0000 -12.2500
Columns 71 through 77
-12.5000 -12.7500 -13.0000 -13.2500 -13.5000 -13.7500 -14.0000
Columns 78 through 84
-14.2500 -14.5000 -14.7500 -15.0000 -15.2500 -15.5000 -15.7500
Columns 85 through 91
-16.0000 -16.2500 -16.5000 -16.7500 -17.0000 -17.2500 -17.5000
Columns 92 through 98
-17.7500 -18.0000 -18.2500 -18.5000 -18.7500 -19.0000 -19.2500
Columns 99 through 105
-19.5000 -19.7500 -20.0000 -20.2500 -20.5000 -20.7500 -21.0000
Columns 106 through 112
-21.2500 -21.5000 -21.7500 -22.0000 -22.2500 -22.5000 -22.7500
Columns 113 through 119
-23.0000 -23.2500 -23.5000 -23.7500 -24.0000 -24.2500 -24.5000
Columns 120 through 126
-24.7500 -25.0000 -25.2500 -25.5000 -25.7500 -26.0000 -26.2500
Columns 127 through 133
-26.5000 -26.7500 -27.0000 -27.2500 -27.5000 -27.7500 -28.0000
Columns 134 through 140
-28.2500 -28.5000 -28.7500 -29.0000 -29.2500 -29.5000 -29.7500
Columns 141 through 147
-30.0000 -30.2500 -30.5000 -30.7500 -31.0000 -31.2500 -31.5000
Columns 148 through 154
-31.7500 -32.0000 -32.2500 -32.5000 -32.7500 -33.0000 -33.2500
Columns 155 through 161
-33.5000 -33.7500 -34.0000 -34.2500 -34.5000 -34.7500 -35.0000
Columns 162 through 168
-35.2500 -35.5000 -35.7500 -36.0000 -36.2500 -36.5000 -36.7500
Columns 169 through 175
-37.0000 -37.2500 -37.5000 -37.7500 -38.0000 -38.2500 -38.5000
Columns 176 through 182
-38.7500 -39.0000 -39.2500 -39.5000 -39.7500 -40.0000 -40.2500
Columns 183 through 189
-40.5000 -40.7500 -41.0000 -41.2500 -41.5000 -41.7500 -42.0000
Columns 190 through 196
-42.2500 -42.5000 -42.7500 -43.0000 -43.2500 -43.5000 -43.7500
Columns 197 through 203
-44.0000 -44.2500 -44.5000 -44.7500 -45.0000 -45.2500 -45.5000
Columns 204 through 210
-45.7500 -46.0000 -46.2500 -46.5000 -46.7500 -47.0000 -47.2500
Columns 211 through 217
-47.5000 -47.7500 -48.0000 -48.2500 -48.5000 -48.7500 -49.0000
Columns 218 through 224
-49.2500 -49.5000 -49.7500 -50.0000 -50.2500 -50.5000 -50.7500
Columns 225 through 231
-51.0000 -51.2500 -51.5000 -51.7500 -52.0000 -52.2500 -52.5000
Columns 232 through 238
-52.7500 -53.0000 -53.2500 -53.5000 -53.7500 -54.0000 -54.2500
Columns 239 through 245
-54.5000 -54.7500 -55.0000 -55.2500 -55.5000 -55.7500 -56.0000
Columns 246 through 252
-56.2500 -56.5000 -56.7500 -57.0000 -57.2500 -57.5000 -57.7500
Columns 253 through 259
-58.0000 -58.2500 -58.5000 -58.7500 -59.0000 -59.2500 -59.5000
Columns 260 through 266
-59.7500 -60.0000 -60.2500 -60.5000 -60.7500 -61.0000 -61.2500
Columns 267 through 273
-61.5000 -61.7500 -62.0000 -62.2500 -62.5000 -62.7500 -63.0000
Columns 274 through 280
-63.2500 -63.5000 -63.7500 -64.0000 -64.2500 -64.5000 -64.7500
Columns 281 through 287
-65.0000 -65.2500 -65.5000 -65.7500 -66.0000 -66.2500 -66.5000
Columns 288 through 294
-66.7500 -67.0000 -67.2500 -67.5000 -67.7500 -68.0000 -68.2500
Columns 295 through 301
-68.5000 -68.7500 -69.0000 -69.2500 -69.5000 -69.7500 -70.0000
Columns 302 through 308
-70.2500 -70.5000 -70.7500 -71.0000 -71.2500 -71.5000 -71.7500
Columns 309 through 315
-72.0000 -72.2500 -72.5000 -72.7500 -73.0000 -73.2500 -73.5000
Columns 316 through 322
-73.7500 -74.0000 -74.2500 -74.5000 -74.7500 -75.0000 -75.2500
Columns 323 through 329
-75.5000 -75.7500 -76.0000 -76.2500 -76.5000 -76.7500 -77.0000
Columns 330 through 336
-77.2500 -77.5000 -77.7500 -78.0000 -78.2500 -78.5000 -78.7500
Columns 337 through 343
-79.0000 -79.2500 -79.5000 -79.7500 -80.0000 -80.2500 -80.5000
Columns 344 through 350
-80.7500 -81.0000 -81.2500 -81.5000 -81.7500 -82.0000 -82.2500
Columns 351 through 357
-82.5000 -82.7500 -83.0000 -83.2500 -83.5000 -83.7500 -84.0000
Columns 358 through 364
-84.2500 -84.5000 -84.7500 -85.0000 -85.2500 -85.5000 -85.7500
Columns 365 through 371
-86.0000 -86.2500 -86.5000 -86.7500 -87.0000 -87.2500 -87.5000
Columns 372 through 378
-87.7500 -88.0000 -88.2500 -88.5000 -88.7500 -89.0000 -89.2500
Columns 379 through 385
-89.5000 -89.7500 -90.0000 -90.2500 -90.5000 -90.7500 -91.0000
Columns 386 through 392
-91.2500 -91.5000 -91.7500 -92.0000 -92.2500 -92.5000 -92.7500
Columns 393 through 399
-93.0000 -93.2500 -93.5000 -93.7500 -94.0000 -94.2500 -94.5000
Columns 400 through 406
-94.7500 -95.0000 -95.2500 -95.5000 -95.7500 -96.0000 -96.2500
Columns 407 through 413
-96.5000 -96.7500 -97.0000 -97.2500 -97.5000 -97.7500 -98.0000
Columns 414 through 420
-98.2500 -98.5000 -98.7500 -99.0000 -99.2500 -99.5000 -99.7500
Column 421
-100.0000
F =
Columns 1 through 7
1.0000 1.1288 1.2743 1.4384 1.6238 1.8330 2.0691
Columns 8 through 14
2.3357 2.6367 2.9764 3.3598 3.7927 4.2813 4.8329
Columns 15 through 20
5.4556 6.1585 6.9519 7.8476 8.8587 10.0000
Output 3.9.6
Solution left to the student.
Output 3.9.7
I =
1 2 3 4 5 6 7 8 9 10
11 12 13 14 15 16 17 18 19 20
21 22 23 24 25 26 27 28 29 30
J1 =
1 2 3 4 5
11 12 13 14 15
21 22 23 24 25
K1 =
21 22 23 24 25
J2 =
1 2 3 4 5
11 12 13 14 15
21 22 23 24 25
K2 =
21 22 23 24 25
Output 3.9.8
Solution left to the student.
Output 3.9.9
Jack =
1 4 7 10 13 16 19 22 25 28 31 34
Jill =
41 44 47 50 53 56 59 62 65 68 71 74
ans =
12
ans =
12
Mary =
1 44 7 50 13 56 19 62 25 68 31 74
Output 3.9.10
Solution left to the student.
Output 3.9.11
LeftToRight =
16 2 3 13
5 11 10 8
9 7 6 12
4 14 15 1
RightToLeft =
13 3 2 16
8 10 11 5
12 6 7 9
1 15 14 4