Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
5 views

Solution Manual for MATLAB: A Practical Introduction to Programming and Problem Solving 5th Edition download

The document provides links to various solution manuals and test banks for textbooks related to MATLAB programming, organizational behavior, and problem-solving concepts. It includes exercises and examples from the MATLAB solution manual, focusing on vectors and matrices, and various programming tasks. The document serves as a resource for students seeking additional help with their coursework.

Uploaded by

dages4lieckvg
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

Solution Manual for MATLAB: A Practical Introduction to Programming and Problem Solving 5th Edition download

The document provides links to various solution manuals and test banks for textbooks related to MATLAB programming, organizational behavior, and problem-solving concepts. It includes exercises and examples from the MATLAB solution manual, focusing on vectors and matrices, and various programming tasks. The document serves as a resource for students seeking additional help with their coursework.

Uploaded by

dages4lieckvg
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 40

Solution Manual for MATLAB: A Practical

Introduction to Programming and Problem Solving


5th Edition download

http://testbankbell.com/product/solution-manual-for-matlab-a-
practical-introduction-to-programming-and-problem-solving-5th-
edition/

Download more testbank from https://testbankbell.com


We believe these products will be a great fit for you. Click
the link to download now, or visit testbankbell.com
to discover even more!

Solution Manual for Organizational Behavior: A


Practical, Problem-Solving Approach, 3rd Edition,
Angelo Kinicki

https://testbankbell.com/product/solution-manual-for-
organizational-behavior-a-practical-problem-solving-approach-3rd-
edition-angelo-kinicki/

Solution Manual for Problem Solving and Programming


Concepts, 9/E 9th Edition Maureen Sprankle, Jim Hubbard

https://testbankbell.com/product/solution-manual-for-problem-
solving-and-programming-concepts-9-e-9th-edition-maureen-
sprankle-jim-hubbard/

Test Bank for Organizational Behavior: A Practical,


Problem-Solving Approach, 3rd Edition, Angelo Kinicki

https://testbankbell.com/product/test-bank-for-organizational-
behavior-a-practical-problem-solving-approach-3rd-edition-angelo-
kinicki/

Test Bank for Organizational Behavior A Practical


Problem Solving Approach 2nd Edition By Kinicki

https://testbankbell.com/product/test-bank-for-organizational-
behavior-a-practical-problem-solving-approach-2nd-edition-by-
kinicki/
Test Bank for Organizational Behavior: A Practical,
Problem-Solving Approach, 3rd Edition Angelo Kinicki

https://testbankbell.com/product/test-bank-for-organizational-
behavior-a-practical-problem-solving-approach-3rd-edition-angelo-
kinicki-3/

Test Bank for Problem Solving and Programming Concepts,


9/E 9th Edition : 0132492644

https://testbankbell.com/product/test-bank-for-problem-solving-
and-programming-concepts-9-e-9th-edition-0132492644/

Solution Manual for C# Programming: From Problem


Analysis to Program Design, 5th Edition, Barbara Doyle

https://testbankbell.com/product/solution-manual-for-c-
programming-from-problem-analysis-to-program-design-5th-edition-
barbara-doyle/

Solution Manual for Business Communication A Problem-


Solving Approach 1st by Rentz

https://testbankbell.com/product/solution-manual-for-business-
communication-a-problem-solving-approach-1st-by-rentz/

Solution Manual for Data Structures and Problem Solving


Using C++ 2/E Mark A. Weiss

https://testbankbell.com/product/solution-manual-for-data-
structures-and-problem-solving-using-c-2-e-mark-a-weiss/
Solution Manual for MATLAB: A
Practical Introduction to Programming
and Problem Solving 5th Edition
Full download chapter at: https://testbankbell.com/product/solution-manual-for-
matlab-a-practical-introduction-to-programming-and-problem-solving-5th-
edition/

Chapter 2: Vectors and Matrices

Exercises

1) If a variable has the dimensions 3 x 4, could it be considered to be (bold all that


apply):
a matrix
a row vector
a column vector
a scalar

2) If a variable has the dimensions 1 x 5, could it be considered to be (bold all that


apply):
a matrix
a row vector
a column vector
a scalar

3) If a variable has the dimensions 5 x 1, could it be considered to be (bold all that


apply):
a matrix
a row vector
a column vector
a scalar

4) If a variable has the dimensions 1 x 1, could it be considered to be (bold all that


apply):
a matrix
a row vector
a column vector
a scalar

5) Using the colon operator, create the following row vectors


3 4 5 6 7 8

1.3000 1.7000 2.1000 2.5000

9 7 5 3

>> 3:8
ans =
3 4 5 6 7 8
>> 1.3: 0.4: 2.5
ans =
1.3000 1.7000 2.1000 2.5000
>> 9: -2: 3
ans =
9 7 5 3

6) Using a built-in function, create a vector vec which consists of 30 equally spaced
points in the range from –2*pi to +pi.

>> vec = linspace(-2*pi, pi, 30)

7) Write an expression using linspace that will result in the same as 1:0.5:3

>> 1: 0.5: 3
ans =
1.0000 1.5000 2.0000 2.5000 3.0000
>> linspace(1,3,5)
ans =
1.0000 1.5000 2.0000 2.5000 3.0000

8) Using the colon operator and also the linspace function, create the following row
vectors:

-4 -3 -2 -1 0

9 7 5

4 6 8

>> -4:0
ans =
-4 -3 -2 -1 0
>> linspace(-4, 0, 5)
ans =
-4 -3 -2 -1 0
>> 9:-2:5
ans =
9 7 5
>> linspace(9, 5, 3)
ans =
9 7 5
>> 4:2:8
ans =
4 6 8
>> linspace(4,8,3)
ans =
4 6 8

9) How many elements would be in the vectors created by the following expressions?
linspace(3,2000)

100 (always, by default)

logspace(3,2000)

50 (always, by default – although these numbers


would get very large quickly; most would be
represented as Inf)

10) Create a variable myend which stores a random integer in the inclusive range from
5 to 9. Using the colon operator, create a vector that iterates from 1 to myend in steps
of 3.

>>myend = randi([5, 9])


myend =
8
>> vec = 1:3:myend
vec =
1 4 7

11) Create two row vector variables. Concatenate them together to create a new row
vector variable.

>> rowa = 2:4


rowa =
2 3 4
>> rowb = 5:2:10
rowb =
5 7 9
>> newrow = [rowa rowb]
newrow =
2 3 4 5 7 9
>>

12) Using the colon operator and the transpose operator, create a column vector
myvec that has the values -1 to 1 in steps of 0.5.

>> rowVec = -1: 0.5: 1;


>> rowVec'
ans =
-1.0000
-0.5000
0
0.5000
1.0000
13)Explain why the following expression results in a row vector, not a column vector:

colvec = 1:3’

Only the 3 is transposed; need to put in [] to get a column


vector

14) Write an expression that refers to only the elements that have odd-numbered
subscripts in a vector, regardless of the length of the vector. Test your expression on
vectors that have both an odd and even number of elements.

>> vec = 1:8;


>> vec(1:2:end)
ans =
1 3 5 7

>> vec = 4:12


vec =
4 5 6 7 8 9 10 11 12
>> vec(1:2:end)
ans =
4 6 8 10 12

15) Generate a 2 x 4 matrix variable mat. Replace the first row with 1:4. Replace the
third column (you decide with which values).

>> mat = [2:5; 1 4 11 3]


mat =
2 3 4 5
1 4 11 3
>> mat(1,:) = 1:4
mat =
1 2 3 4
1 4 11 3
>> mat(:,3) = [4;3]
mat =
1 2 4 4
1 4 3 3

16) Generate a 2 x 4 matrix variable mat. Verify that the number of elements is equal to
the product of the number of rows and columns.

>> mat = randi(20,2,4)


mat =
1 19 17 9
13 15 20 16
>> [r c] = size(mat);
>> numel(mat) == r * c
ans =
1

17) Which would you normally use for a matrix: length or size? Why?

Definitely size, because it tells you both the number of


rows and columns.

18) When would you use length vs. size for a vector?

If you want to know the number of elements, you’d use


length. If you want to figure out whether it’s a row or
column vector, you’d use size.

19) Generate a 2 x 3 matrix of random


• real numbers, each in the range (0, 1)
• real numbers, each in the range (0, 5)
• integers, each in the inclusive range from 10 to 50

>> rand(2,3)
ans =
0.5208 0.5251 0.1665
0.1182 0.1673 0.2944

>> rand(2,3)*5
ans =
1.9468 2.3153 4.6954
0.8526 2.9769 3.2779

>> randi([10, 50], 2, 3)


ans =
16 20 39
12 17 27

20) Create a variable rows that is a random integer in the inclusive range from 1 to 5.
Create a variable cols that is a random integer in the inclusive range from 1 to 5.
Create a matrix of all zeros with the dimensions given by the values of rows and cols.

>> rows = randi([1,5])


rows =
3
>> cols = randi([1,5])
cols =
2
>> zeros(rows,cols)
ans =
0 0
0 0
0 0

21) Create a vector variable vec. Find as many expressions as you can that would
refer to the last element in the vector, without assuming that you know how many
elements it has (i.e., make your expressions general).

>> vec = 1:2:9


vec =
1 3 5 7 9
>> vec(end)
ans =
9
>> vec(numel(vec))
ans =
9
>> vec(length(vec))
ans =
9
>> v = fliplr(vec);
>> v(1)
ans =
9

22) Create a matrix variable mat. Find as many expressions as you can that would
refer to the last element in the matrix, without assuming that you know how many
elements or rows or columns it has (i.e., make your expressions general).

>> mat = [12:15; 6:-1:3]


mat =
12 13 14 15
6 5 4 3
>> mat(end,end)
ans =
3
>> mat(end)
ans =
3
>> [r c] = size(mat);
>> mat(r,c)
ans =
3
23) Create a 2 x 3 matrix variable mat. Pass this matrix variable to each of the following
functions and make sure you understand the result: flip, fliplr, flipud, and rot90. In
how many different ways can you reshape it?

>> mat = randi([1,20], 2,3)


mat =
16 5 8
15 18 1
>> flip(mat)
ans =
15 18 1
16 5 8
>>fliplr(mat)
ans =
8 5 16
1 18 15
>> flipud(mat)
ans =
15 18 1
16 5 8
>> rot90(mat)
ans =
8 1
5 18
16 15
>> rot90(rot90(mat))
ans =
1 18 15
8 5 16
>> reshape(mat,3,2)
ans =
16 18
15 8
5 1
>> reshape(mat,1,6)
ans =
16 15 5 18 8 1
>> reshape(mat,6,1)
ans =
16
15
5
18
8
1

24) What is the difference between fliplr(mat) and mat = fliplr(mat)?


The first stores the result in ans so mat is not changed; the second changes mat.

25) Fill in the following:

The function flip is equivalent to the function fliplr for a row vector.
The function flip is equivalent to the function flipud for a column vector.
The function flip is equivalent to the function flipud for a matrix.

26) Use reshape to reshape the row vector 1:4 into a 2x2 matrix; store this in a variable
named mat. Next, make 2x3 copies of mat using both repelem and repmat.

>> mat = reshape(1:4,2,2)


mat =
1 3
2 4
>> repelem(mat,2,3)
ans =
1 1 1 3 3 3
1 1 1 3 3 3
2 2 2 4 4 4
2 2 2 4 4 4
>> repmat(mat,2,3)
ans =
1 3 1 3 1 3
2 4 2 4 2 4
1 3 1 3 1 3
2 4 2 4 2 4

27) Create a 3 x 5 matrix of random real numbers. Delete the third row.

>> mat = rand(3,5)


mat =
0.5226 0.9797 0.8757 0.0118 0.2987
0.8801 0.2714 0.7373 0.8939 0.6614
0.1730 0.2523 0.1365 0.1991 0.2844

>> mat(3,:) = []
mat =
0.5226 0.9797 0.8757 0.0118 0.2987
0.8801 0.2714 0.7373 0.8939 0.6614

28) Given the matrix:


>> mat = randi([1 20], 3,5)
mat =
6 17 7 13 17
17 5 4 10 12
6 19 6 8 11
Why wouldn’t this work:

mat(2:3, 1:3) = ones(2)

Because the left and right sides are not the same dimensions.

29) Create a three-dimensional matrix with dimensions 2 x 4 x 3 in which the first


“layer” is all 0s, the second is all 1s and the third is all 5s. Use size to verify the
dimensions.

>> mat3d = zeros(2,4,3);


>> mat3d(:,:,2) = 1;
>> mat3d(:,:,3) = 5;
>> mat3d
mat3d(:,:,1) =
0 0 0 0
0 0 0 0
mat3d(:,:,2) =
1 1 1 1
1 1 1 1
mat3d(:,:,3) =
5 5 5 5
5 5 5 5
>> size(mat3d)
ans =
2 4 3

30) Create a vector x which consists of 20 equally spaced points in the range from – to
+. Create a y vector which is sin(x).

>> x = linspace(-pi,pi,20);
>> y = sin(x);

31) Create a 3 x 5 matrix of random integers, each in the inclusive range from -5 to 5.
Get the sign of every element.

>> mat = randi([-5,5], 3,5)


mat =
5 4 1 -1 -5
4 4 -1 -3 0
5 -2 1 0 4
>> sign(mat)
ans =
1 1 1 -1 -1
1 1 -1 -1 0
1 -1 1 0 1

32) Find the sum 2+4+6+8+10 using sum and the colon operator.

>> sum(2:2:10)
ans =
30

33) Find the sum of the first n terms of the harmonic series where n is an integer
variable greater than one.
1 1 1 1
1 + + + + +…
2 3 4 5

>> n = 4;
>> sum(1./(1:n))
ans =
2.0833

34) Find the following sum by first creating vectors for the numerators and
denominators:

3 5 7 9
+ + +
1 2 3 4

>> num = 3:2:9


num =
3 5 7 9
>> denom = 1:4
denom =
1 2 3 4
>> fracs = num ./ denom
fracs =
3.0000 2.5000 2.3333 2.2500
>> sum(fracs)
ans =
10.0833

35) Create a matrix and find the product of each row and column using prod.

>> mat = randi([1, 30], 2,3)


mat =
11 24 16
5 10 5

>> prod(mat)
ans =
55 240 80

>> prod(mat,2)
ans =
4224
250

36) Create a 1 x 6 vector of random integers, each in the inclusive range from 1 to 20.
Use built-in functions to find the minimum and maximum values in the vector. Also
create a vector of cumulative sums using cumsum.

>> vec = randi([1,20], 1,6)


vec =
12 20 10 17 15 10
>> min(vec)
ans =
10
>> max(vec)
ans =
20
>> cvec = cumsum(vec)
cvec =
12 32 42 59 74 84

37) Write a relational expression for a vector variable that will verify that the last value in
a vector created by cumsum is the same as the result returned by sum.

>> vec = 2:3:17


vec =
2 5 8 11 14 17
>> cv = cumsum(vec)
cv =
2 7 15 26 40 57
>> sum(vec) == cv(end)
ans =
1

38) Create a vector of five random integers, each in the inclusive range from -10 to 10.
Perform each of the following:

• subtract 3 from each element


• count how many are positive
• get the cumulative minimum

>> vec = randi([-10, 10], 1,5)


vec =
1 8 3 -7 7
>> vec - 3
ans =
-2 5 0 -10 4
>> sum(vec>0)
ans =
4
>> cummin(vec)
ans =
1 1 1 -7 -7

39) Create a 3 x 5 matrix. Perform each of the following:

• Find the maximum value in each column.


• Find the maximum value in each row.
• Find the maximum value in the entire matrix.
• Find the cumulative maxima.

>> mat = randi([-10 10], 3,5)


mat =
1 -5 0 -2 10
2 1 1 6 -3
-6 10 -3 5 2
>> max(mat)
ans =
2 10 1 6 10
>> max(mat, [], 2)
ans =
10
6
10
>> max(mat')
ans =
10 6 10
>> max(max(mat))
ans =
10
>> cummax(mat)
ans =
1 -5 0 -2 10
2 1 1 6 10
2 10 1 6 10

40) Find two ways to create a 3 x 5 matrix of all 100s (Hint: use ones and zeros).

ones(3,5)*100
zeros(3,5)+100

41) Create variables for these two matrices:

A B
é 1 2 3 ùé
ê 2 4 1 ù
ú ê ú
ë 4 -1 6 û ë 1 3 0 û

Perform the following operations:


A + B
é3 6 4 ù
ê ú
ë5 2 6 û
A – B
é -1 -2 2 ù
ê ú
ë 3 -4 6 û
A .* B

é2 8 3 ù
ê ú
ë 4 -3 0 û

42) A vector v stores for several employees of the Green Fuel Cells Corporation their
hours worked one week followed for each by the hourly pay rate. For example, if the
variable stores
>> v
v =
33.0000 10.5000 40.0000 18.0000 20.0000 7.5000
that means the first employee worked 33 hours at $10.50 per hour, the second worked
40 hours at $18 an hour, and so on. Write code that will separate this into two vectors,
one that stores the hours worked and another that stores the hourly rates. Then, use
the array multiplication operator to create a vector, storing in the new vector the total
pay for every employee.

>> hours = v(1:2:length(v))


hours =
33 40 20

>> payrate = v(2:2:length(v))


payrate =
10.5000 18.0000 7.5000

>> totpay = hours .* payrate


totpay =
346.5000 720.0000 150.0000
43) Write code that would count how many elements in a matrix variable mat are
negative numbers. Create a matrix of random numbers, some positive and some
negative, first.

>> mat
mat =
1 -5 0 -2 10
2 1 1 6 -3
-6 10 -3 5 2
>> sum(sum(mat < 0))
ans =
5

44) A company is calibrating some measuring instrumentation and has measured the
radius and height of one cylinder 8 separate times; they are in vector variables r and h.
Find the volume from each trial, which is given by Πr2h. Also use logical indexing first to
make sure that all measurements were valid (> 0).

>> r = [5.499 5.498 5.5 5.5 5.52 5.51 5.5 5.48];


>> h = [11.1 11.12 11.09 11.11 11.11 11.1 11.08 11.11];

>> all(r>0 & h>0)


ans =
1
>> vol = pi * r.^2 .* h

45) For the following matrices A, B, and C:


2 1 3
1 4   3 2 5
A=   B = 1 5 6  C=  
3 2 3 6 0 4 1 2 

• Give the result of 3*A.

3 12
 
9 6 

• Give the result of A*C.


19 6 13
 
17 8 19

• Are there any other matrix multiplications that can be performed? If so, list them.
C*B

46) Create a row vector variable r that has 4 elements, and a column vector variable c
that has 4 elements. Perform r*c and c*r.

>> r = randi([1 10], 1, 4)


r =
3 8 2 9
>> c = randi([1 10], 4, 1)
c =
4
9
7
8
>> r*c
ans =
170
>> c*r
ans =
12 32 8 36
27 72 18 81
21 56 14 63
24 64 16 72

47) The matrix variable rainmat stores the total rainfall in inches for some districts for
the years 2014-2017. Each row has the rainfall amounts for a given district. For
example, if rainmat has the value:

>> rainmat
ans =
25 33 29 42
53 44 40 56
etc.

district 1 had 25 inches in 2014, 33 in 2015, etc. Write expression(s) that will find the
number of the district that had the highest total rainfall for the entire four year period.

>> rainmat = [25 33 29 42; 53 44 40 56];


>> large = max(max(rainmat))
large =
56
>> linind = find(rainmat== large)
linind =
8
>> floor(linind/4)
ans =
2

48) Generate a vector of 20 random integers, each in the range from 50 to 100. Create
a variable evens that stores all of the even numbers from the vector, and a variable
odds that stores the odd numbers.

>> nums = randi([50, 100], 1, 20);


>> evens = nums(rem(nums,2)==0);
>> odds = nums(rem(nums,2)~=0);

49) Assume that the function diff does not exist. Write your own expression(s) to
accomplish the same thing for a vector.

>> vec = [5 11 2 33 -4]


vec =
5 11 2 33 -4
>> v1 = vec(2:end);
>> v2 = vec(1:end-1);
>> v1-v2
ans =
6 -9 31 -37

50) Create a vector variable vec; it can have any length. Then, write assignment
statements that would store the first half of the vector in one variable and the second
half in another. Make sure that your assignment statements are general, and work
whether vec has an even or odd number of elements (Hint: use a rounding function
such as fix).

>> vec = 1:9;


>> fhalf = vec(1:fix(length(vec)/2))
fhalf =
1 2 3 4
>> shalf = vec(fix(length(vec)/2)+1:end)
shalf =
5 6 7 8 9
Another Random Document on
Scribd Without Any Related Topics
reward his ambition, should it prompt him to move upward into a
higher class. Now this is no trifling matter, for the very essence of
good prison discipline is the subordination of mere punishment to
reformation; and this system of classification tends not only to
preserve a man's self-respect, but to fan the spark of hope that
otherwise might be extinguished in his breast.
The justly celebrated novel Never too late to Mend has made the
public in some degree familiar with the 'silent system' of prison
discipline. This system has been found not to work when sentences
are for a long period. Speech is discovered to be more than a luxury,
being essential to the mental health of prisoners. None now are
condemned to the silent system except those who are imprisoned
for only a short time. And how great is the punishment of not being
allowed to speak, is proved to the chaplain by this one fact.
Nowhere are prayers so diligently responded to and hymns sung
with such will, if without musical taste, as in the chapel of a military
prison, for prisoners recognise the service as an opportunity of
convincing themselves that they have not become dumb. Until this
explanation was given by the governor, I was full of admiration for
religion, afterwards discovered to be more loud-sounding than
genuine.
Prisoners condemned to solitary confinement are forced to turn to
the wall on the approach of visitors or the superior officers of the
prison. 'Has my face assumed any terrific aspect? Am I so much
worse-looking than usual?' This is the thought that naturally comes
into one's mind on walking through a military prison for the first
time. Each man takes a quick glance at your Gorgon head, and then,
fast as lightning, turns his back to you and his face to the wall, until
your apparently baneful or bewitching influence has passed.
Another humiliation to which prisoners have to submit is that of
having their hair frequently cut short. A man must sink very low
indeed before he lose altogether personal vanity. It would seem as if
there were a peacock as well as an angel and a beast in each of us.
For this reason the regulation that requires the hair of all prisoners
of the third class to be cropped every fortnight is no slight
punishment. It is especially felt by those who leave the prison
without having been promoted to the second and first classes, in
which a prisoner's hair is permitted to grow during the last fortnight
of imprisonment. How can a man shew himself in respectable
society, or take off his hat to a lady, when that common act of
courtesy would reveal the fact that his hair was cut by—
government?
Some may desire to know whether flogging has or has not been
entirely abolished. To the question, we answer: 'Yes; except for
aggravated breaches of prison discipline.' Nor is it easy to see in
what other way such cases can be dealt with. A man, let us suppose
in a fit of sulky stubbornness, does not attempt to pick his oakum.
He is brought before the governor, and sentenced to lose his supper
and bed; that is, to be obliged to sleep on the floor. On going back
to his cell he says to himself: 'What can I do now to avenge myself
on the authorities?' and he acts on the impulse that seizes him,
which is to break the window and destroy everything in his cell.
Probably this sort of stubborn ill-conditioned character is a coward;
and if this be the case, nothing is found to bring him to his senses so
well as twenty-five lashes administered in the presence of the
governor and medical officer.
The punishments which we should like to see abolished, if others
without equal or greater disadvantages could be discovered, are the
crank and shot-drill. 'What is the crank?' may be asked by happy
people who have never had to do with prisons in any way. It is, we
answer, a Sisyphus' wheel that the prisoner is forced to turn twelve
or fourteen thousand times each day, for no other reason than
because the useless monotonous exercise is sufficiently hateful to
him to be a real punishment. 'To what purpose is this waste?' we
may ask. Why is this wheel not made to pump water or grind corn or
do some other useful work? Why should a man be degraded into a
machine, and made to turn a wheel merely for the sake of turning
it? Will he not in this way lose all self-respect? Yes; these are the
unanswerable arguments against the crank. But then its very
uselessness is urged as an argument for its retention. Suppose, for
instance, that prisoners are employed in gardens where vegetables
are cultivated for barrack-use, what will be the consequence? That
soldiers will desire to abandon their own profession for Adam's
calling, and for this purpose will designedly get into prison. If, again,
the crank-wheel be utilised in any way, men will feel that they are
useful members of society, and will probably prefer their new work
to the dull routine and irksome duties of barrack-life. Almost the
same remarks are applicable to shot-drill, or the very humiliating
process of lifting six times each minute for three hours per diem a
thirty-six pound cannon-ball, for no other reason than to put it down
again three paces from where it originally lay. Nothing can be more
fatiguing and worrying than this process of putting the shot there
and back, there and back, there and back! But then we must again
remark, that to make prisons very comfortable is absolutely to make
them useless.
Almost all the inmates of military prisons are sentenced for such
crimes as these: Desertion—the commonest crime of all—making
away with kit, breaking out of barracks, insubordination. How is
desertion to be stopped? This is now a very difficult problem with
the authorities, and almost all officers give it as their opinion that
the plague of desertion can only be stayed by again having recourse
to the system lately abolished of branding the letter D on the
deserter's side. In the absence of this Nota bene, there is nothing to
prevent a soldier from enlisting over and over again in different
corps, in order to get a bounty and new kit on each occasion.
As regards insubordination, when you speak to a prisoner on the
folly of having resisted or disobeyed a non-commissioned officer, he
will generally give an answer somewhat as follows: 'Well, sir, when I
came back from foreign service I had a little money, and with this I
drank with some comrades more than was good for me. There is a
corporal [or sergeant] in the barrack-room who is always down on
me; and upon that day, having had a little too much, I could not
stand his going on at me; and so I—though indeed I tried to help
myself doing so—just struck him between his eyes.' There is no
doubt that nine out of every ten soldiers in military prisons have got
into trouble through drink. A soldier was once overheard describing
the advantages of the Cape as a station in these words: 'Drink is
cheap, and you are always dry.' Men of this stamp fill our military
prisons.
In some cases the crime of insubordination is provoked by the petty
bullying and offensive manner of non-commissioned officers, though
their superiors do their best to check them. Officers are now easily
accessible, and are ready to give the youngest private an impartial
hearing. In all respects the position of a British soldier is now greatly
improved. Indeed it is not too much to say that life in a military
prison now is quite as endurable as was existence out of it to the
well-conducted soldier of forty years ago.
DESOLATE.
Like a funereal pall,
Darkness lies over all;
Weirdly the owl doth call
From her lone steep.
Sadly the night-wind blows
Over December snows;
Vain 'tis my eyes to close—
I cannot sleep.

Thy voice is in my ear;


Once more thy words I hear,
Bringing now hope now fear,
But always love;
And thy sweet face doth rise
Radiant with starry eyes,
Cloudless as summer skies
In heaven above.

Once more at night's soft noon,


Under the pensive moon
Of a long vanished June,
With thee I stray:
As when in days of old
All my heart's love I told,
And to my pleading bold
Thou saidst not nay.

When thou wast by my side,


Calmly the days did glide;
Like an unruffled tide
My life did flow.
Then was each hour too brief;
Now I but seek relief
From my consuming grief,
Rest from my woe.

Now falls the scalding tear,


Shed for the present drear;
Shed for the past so dear,
So quickly flown.
Over thy lonely grave,
Hard by the sounding wave,
Madly the wind-gusts rave;
I am alone.

Yes; but my whole life through


Leal have I been and true;
True shall I be to you,
As true as then;
Till when that life is o'er,
Skyward my soul shall soar,
And on the heavenly shore
We meet again.

H. D.

Printed and Published by W. & R. Chambers, 47 Paternoster Row,


London, and 339 High Street, Edinburgh.

All Rights Reserved.


*** END OF THE PROJECT GUTENBERG EBOOK CHAMBERS'S
JOURNAL OF POPULAR LITERATURE, SCIENCE, AND ART, NO. 729,
DECEMBER 15, 1877 ***

Updated editions will replace the previous one—the old editions


will be renamed.

Creating the works from print editions not protected by U.S.


copyright law means that no one owns a United States
copyright in these works, so the Foundation (and you!) can copy
and distribute it in the United States without permission and
without paying copyright royalties. Special rules, set forth in the
General Terms of Use part of this license, apply to copying and
distributing Project Gutenberg™ electronic works to protect the
PROJECT GUTENBERG™ concept and trademark. Project
Gutenberg is a registered trademark, and may not be used if
you charge for an eBook, except by following the terms of the
trademark license, including paying royalties for use of the
Project Gutenberg trademark. If you do not charge anything for
copies of this eBook, complying with the trademark license is
very easy. You may use this eBook for nearly any purpose such
as creation of derivative works, reports, performances and
research. Project Gutenberg eBooks may be modified and
printed and given away—you may do practically ANYTHING in
the United States with eBooks not protected by U.S. copyright
law. Redistribution is subject to the trademark license, especially
commercial redistribution.

START: FULL LICENSE


THE FULL PROJECT GUTENBERG LICENSE
PLEASE READ THIS BEFORE YOU DISTRIBUTE OR USE THIS WORK

To protect the Project Gutenberg™ mission of promoting the


free distribution of electronic works, by using or distributing this
work (or any other work associated in any way with the phrase
“Project Gutenberg”), you agree to comply with all the terms of
the Full Project Gutenberg™ License available with this file or
online at www.gutenberg.org/license.

Section 1. General Terms of Use and


Redistributing Project Gutenberg™
electronic works
1.A. By reading or using any part of this Project Gutenberg™
electronic work, you indicate that you have read, understand,
agree to and accept all the terms of this license and intellectual
property (trademark/copyright) agreement. If you do not agree
to abide by all the terms of this agreement, you must cease
using and return or destroy all copies of Project Gutenberg™
electronic works in your possession. If you paid a fee for
obtaining a copy of or access to a Project Gutenberg™
electronic work and you do not agree to be bound by the terms
of this agreement, you may obtain a refund from the person or
entity to whom you paid the fee as set forth in paragraph 1.E.8.

1.B. “Project Gutenberg” is a registered trademark. It may only


be used on or associated in any way with an electronic work by
people who agree to be bound by the terms of this agreement.
There are a few things that you can do with most Project
Gutenberg™ electronic works even without complying with the
full terms of this agreement. See paragraph 1.C below. There
are a lot of things you can do with Project Gutenberg™
electronic works if you follow the terms of this agreement and
help preserve free future access to Project Gutenberg™
electronic works. See paragraph 1.E below.
1.C. The Project Gutenberg Literary Archive Foundation (“the
Foundation” or PGLAF), owns a compilation copyright in the
collection of Project Gutenberg™ electronic works. Nearly all the
individual works in the collection are in the public domain in the
United States. If an individual work is unprotected by copyright
law in the United States and you are located in the United
States, we do not claim a right to prevent you from copying,
distributing, performing, displaying or creating derivative works
based on the work as long as all references to Project
Gutenberg are removed. Of course, we hope that you will
support the Project Gutenberg™ mission of promoting free
access to electronic works by freely sharing Project Gutenberg™
works in compliance with the terms of this agreement for
keeping the Project Gutenberg™ name associated with the
work. You can easily comply with the terms of this agreement
by keeping this work in the same format with its attached full
Project Gutenberg™ License when you share it without charge
with others.

1.D. The copyright laws of the place where you are located also
govern what you can do with this work. Copyright laws in most
countries are in a constant state of change. If you are outside
the United States, check the laws of your country in addition to
the terms of this agreement before downloading, copying,
displaying, performing, distributing or creating derivative works
based on this work or any other Project Gutenberg™ work. The
Foundation makes no representations concerning the copyright
status of any work in any country other than the United States.

1.E. Unless you have removed all references to Project


Gutenberg:

1.E.1. The following sentence, with active links to, or other


immediate access to, the full Project Gutenberg™ License must
appear prominently whenever any copy of a Project
Gutenberg™ work (any work on which the phrase “Project
Gutenberg” appears, or with which the phrase “Project
Gutenberg” is associated) is accessed, displayed, performed,
viewed, copied or distributed:

This eBook is for the use of anyone anywhere in the United


States and most other parts of the world at no cost and
with almost no restrictions whatsoever. You may copy it,
give it away or re-use it under the terms of the Project
Gutenberg License included with this eBook or online at
www.gutenberg.org. If you are not located in the United
States, you will have to check the laws of the country
where you are located before using this eBook.

1.E.2. If an individual Project Gutenberg™ electronic work is


derived from texts not protected by U.S. copyright law (does not
contain a notice indicating that it is posted with permission of
the copyright holder), the work can be copied and distributed to
anyone in the United States without paying any fees or charges.
If you are redistributing or providing access to a work with the
phrase “Project Gutenberg” associated with or appearing on the
work, you must comply either with the requirements of
paragraphs 1.E.1 through 1.E.7 or obtain permission for the use
of the work and the Project Gutenberg™ trademark as set forth
in paragraphs 1.E.8 or 1.E.9.

1.E.3. If an individual Project Gutenberg™ electronic work is


posted with the permission of the copyright holder, your use and
distribution must comply with both paragraphs 1.E.1 through
1.E.7 and any additional terms imposed by the copyright holder.
Additional terms will be linked to the Project Gutenberg™
License for all works posted with the permission of the copyright
holder found at the beginning of this work.

1.E.4. Do not unlink or detach or remove the full Project


Gutenberg™ License terms from this work, or any files
containing a part of this work or any other work associated with
Project Gutenberg™.

1.E.5. Do not copy, display, perform, distribute or redistribute


this electronic work, or any part of this electronic work, without
prominently displaying the sentence set forth in paragraph 1.E.1
with active links or immediate access to the full terms of the
Project Gutenberg™ License.

1.E.6. You may convert to and distribute this work in any binary,
compressed, marked up, nonproprietary or proprietary form,
including any word processing or hypertext form. However, if
you provide access to or distribute copies of a Project
Gutenberg™ work in a format other than “Plain Vanilla ASCII” or
other format used in the official version posted on the official
Project Gutenberg™ website (www.gutenberg.org), you must,
at no additional cost, fee or expense to the user, provide a copy,
a means of exporting a copy, or a means of obtaining a copy
upon request, of the work in its original “Plain Vanilla ASCII” or
other form. Any alternate format must include the full Project
Gutenberg™ License as specified in paragraph 1.E.1.

1.E.7. Do not charge a fee for access to, viewing, displaying,


performing, copying or distributing any Project Gutenberg™
works unless you comply with paragraph 1.E.8 or 1.E.9.

1.E.8. You may charge a reasonable fee for copies of or


providing access to or distributing Project Gutenberg™
electronic works provided that:

• You pay a royalty fee of 20% of the gross profits you derive
from the use of Project Gutenberg™ works calculated using the
method you already use to calculate your applicable taxes. The
fee is owed to the owner of the Project Gutenberg™ trademark,
but he has agreed to donate royalties under this paragraph to
the Project Gutenberg Literary Archive Foundation. Royalty
payments must be paid within 60 days following each date on
which you prepare (or are legally required to prepare) your
periodic tax returns. Royalty payments should be clearly marked
as such and sent to the Project Gutenberg Literary Archive
Foundation at the address specified in Section 4, “Information
about donations to the Project Gutenberg Literary Archive
Foundation.”

• You provide a full refund of any money paid by a user who


notifies you in writing (or by e-mail) within 30 days of receipt
that s/he does not agree to the terms of the full Project
Gutenberg™ License. You must require such a user to return or
destroy all copies of the works possessed in a physical medium
and discontinue all use of and all access to other copies of
Project Gutenberg™ works.

• You provide, in accordance with paragraph 1.F.3, a full refund of


any money paid for a work or a replacement copy, if a defect in
the electronic work is discovered and reported to you within 90
days of receipt of the work.

• You comply with all other terms of this agreement for free
distribution of Project Gutenberg™ works.

1.E.9. If you wish to charge a fee or distribute a Project


Gutenberg™ electronic work or group of works on different
terms than are set forth in this agreement, you must obtain
permission in writing from the Project Gutenberg Literary
Archive Foundation, the manager of the Project Gutenberg™
trademark. Contact the Foundation as set forth in Section 3
below.

1.F.

1.F.1. Project Gutenberg volunteers and employees expend


considerable effort to identify, do copyright research on,
transcribe and proofread works not protected by U.S. copyright
law in creating the Project Gutenberg™ collection. Despite these
efforts, Project Gutenberg™ electronic works, and the medium
on which they may be stored, may contain “Defects,” such as,
but not limited to, incomplete, inaccurate or corrupt data,
transcription errors, a copyright or other intellectual property
infringement, a defective or damaged disk or other medium, a
computer virus, or computer codes that damage or cannot be
read by your equipment.

1.F.2. LIMITED WARRANTY, DISCLAIMER OF DAMAGES - Except


for the “Right of Replacement or Refund” described in
paragraph 1.F.3, the Project Gutenberg Literary Archive
Foundation, the owner of the Project Gutenberg™ trademark,
and any other party distributing a Project Gutenberg™ electronic
work under this agreement, disclaim all liability to you for
damages, costs and expenses, including legal fees. YOU AGREE
THAT YOU HAVE NO REMEDIES FOR NEGLIGENCE, STRICT
LIABILITY, BREACH OF WARRANTY OR BREACH OF CONTRACT
EXCEPT THOSE PROVIDED IN PARAGRAPH 1.F.3. YOU AGREE
THAT THE FOUNDATION, THE TRADEMARK OWNER, AND ANY
DISTRIBUTOR UNDER THIS AGREEMENT WILL NOT BE LIABLE
TO YOU FOR ACTUAL, DIRECT, INDIRECT, CONSEQUENTIAL,
PUNITIVE OR INCIDENTAL DAMAGES EVEN IF YOU GIVE
NOTICE OF THE POSSIBILITY OF SUCH DAMAGE.

1.F.3. LIMITED RIGHT OF REPLACEMENT OR REFUND - If you


discover a defect in this electronic work within 90 days of
receiving it, you can receive a refund of the money (if any) you
paid for it by sending a written explanation to the person you
received the work from. If you received the work on a physical
medium, you must return the medium with your written
explanation. The person or entity that provided you with the
defective work may elect to provide a replacement copy in lieu
of a refund. If you received the work electronically, the person
or entity providing it to you may choose to give you a second
opportunity to receive the work electronically in lieu of a refund.
If the second copy is also defective, you may demand a refund
in writing without further opportunities to fix the problem.

1.F.4. Except for the limited right of replacement or refund set


forth in paragraph 1.F.3, this work is provided to you ‘AS-IS’,
WITH NO OTHER WARRANTIES OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO WARRANTIES OF
MERCHANTABILITY OR FITNESS FOR ANY PURPOSE.

1.F.5. Some states do not allow disclaimers of certain implied


warranties or the exclusion or limitation of certain types of
damages. If any disclaimer or limitation set forth in this
agreement violates the law of the state applicable to this
agreement, the agreement shall be interpreted to make the
maximum disclaimer or limitation permitted by the applicable
state law. The invalidity or unenforceability of any provision of
this agreement shall not void the remaining provisions.

1.F.6. INDEMNITY - You agree to indemnify and hold the


Foundation, the trademark owner, any agent or employee of the
Foundation, anyone providing copies of Project Gutenberg™
electronic works in accordance with this agreement, and any
volunteers associated with the production, promotion and
distribution of Project Gutenberg™ electronic works, harmless
from all liability, costs and expenses, including legal fees, that
arise directly or indirectly from any of the following which you
do or cause to occur: (a) distribution of this or any Project
Gutenberg™ work, (b) alteration, modification, or additions or
deletions to any Project Gutenberg™ work, and (c) any Defect
you cause.

Section 2. Information about the Mission


of Project Gutenberg™
Project Gutenberg™ is synonymous with the free distribution of
electronic works in formats readable by the widest variety of
computers including obsolete, old, middle-aged and new
computers. It exists because of the efforts of hundreds of
volunteers and donations from people in all walks of life.

Volunteers and financial support to provide volunteers with the


assistance they need are critical to reaching Project
Gutenberg™’s goals and ensuring that the Project Gutenberg™
collection will remain freely available for generations to come. In
2001, the Project Gutenberg Literary Archive Foundation was
created to provide a secure and permanent future for Project
Gutenberg™ and future generations. To learn more about the
Project Gutenberg Literary Archive Foundation and how your
efforts and donations can help, see Sections 3 and 4 and the
Foundation information page at www.gutenberg.org.

Section 3. Information about the Project


Gutenberg Literary Archive Foundation
The Project Gutenberg Literary Archive Foundation is a non-
profit 501(c)(3) educational corporation organized under the
laws of the state of Mississippi and granted tax exempt status
by the Internal Revenue Service. The Foundation’s EIN or
federal tax identification number is 64-6221541. Contributions
to the Project Gutenberg Literary Archive Foundation are tax
deductible to the full extent permitted by U.S. federal laws and
your state’s laws.

The Foundation’s business office is located at 809 North 1500


West, Salt Lake City, UT 84116, (801) 596-1887. Email contact
links and up to date contact information can be found at the
Foundation’s website and official page at
www.gutenberg.org/contact
Section 4. Information about Donations to
the Project Gutenberg Literary Archive
Foundation
Project Gutenberg™ depends upon and cannot survive without
widespread public support and donations to carry out its mission
of increasing the number of public domain and licensed works
that can be freely distributed in machine-readable form
accessible by the widest array of equipment including outdated
equipment. Many small donations ($1 to $5,000) are particularly
important to maintaining tax exempt status with the IRS.

The Foundation is committed to complying with the laws


regulating charities and charitable donations in all 50 states of
the United States. Compliance requirements are not uniform
and it takes a considerable effort, much paperwork and many
fees to meet and keep up with these requirements. We do not
solicit donations in locations where we have not received written
confirmation of compliance. To SEND DONATIONS or determine
the status of compliance for any particular state visit
www.gutenberg.org/donate.

While we cannot and do not solicit contributions from states


where we have not met the solicitation requirements, we know
of no prohibition against accepting unsolicited donations from
donors in such states who approach us with offers to donate.

International donations are gratefully accepted, but we cannot


make any statements concerning tax treatment of donations
received from outside the United States. U.S. laws alone swamp
our small staff.

Please check the Project Gutenberg web pages for current


donation methods and addresses. Donations are accepted in a
number of other ways including checks, online payments and
credit card donations. To donate, please visit:
www.gutenberg.org/donate.

Section 5. General Information About


Project Gutenberg™ electronic works
Professor Michael S. Hart was the originator of the Project
Gutenberg™ concept of a library of electronic works that could
be freely shared with anyone. For forty years, he produced and
distributed Project Gutenberg™ eBooks with only a loose
network of volunteer support.

Project Gutenberg™ eBooks are often created from several


printed editions, all of which are confirmed as not protected by
copyright in the U.S. unless a copyright notice is included. Thus,
we do not necessarily keep eBooks in compliance with any
particular paper edition.

Most people start at our website which has the main PG search
facility: www.gutenberg.org.

This website includes information about Project Gutenberg™,


including how to make donations to the Project Gutenberg
Literary Archive Foundation, how to help produce our new
eBooks, and how to subscribe to our email newsletter to hear
about new eBooks.

You might also like