diff --git a/doc/C05_TutorialAdvancedInitialization.dox b/doc/C05_TutorialAdvancedInitialization.dox
index b6293bef2..4f27f1e4d 100644
--- a/doc/C05_TutorialAdvancedInitialization.dox
+++ b/doc/C05_TutorialAdvancedInitialization.dox
@@ -32,20 +32,20 @@ or too many coefficients, Eigen will complain.
\verbinclude Tutorial_commainit_01.out
-The comma initializer can also be used to fill block expressions such as m.row(i). Here is a more
-complicated way to get the same result as above:
+Moreover, the elements of the initialization list may themselves be vectors or matrices. A common use is
+to join vectors or matrices together. For example, here is how to join two row vectors together. Remember
+that you have to set the size before you can use the comma initializer.
Example: | Output: |
-\include Tutorial_commainit_01b.cpp
+\include Tutorial_AdvancedInitialization_Join.cpp
|
-\verbinclude Tutorial_commainit_01b.out
+\verbinclude Tutorial_AdvancedInitialization_Join.out
|
-Moreover, the elements of the initialization list may themselves be matrices. Thus, we can use them to
-initialize matrices with a block structure.
+We can use the same technique to initialize matrices with a block structure.
Example: | Output: |
@@ -56,6 +56,18 @@ initialize matrices with a block structure.
\verbinclude Tutorial_AdvancedInitialization_Block.out
+The comma initializer can also be used to fill block expressions such as m.row(i). Here is a more
+complicated way to get the same result as in the first example above:
+
+
+Example: | Output: |
+
+\include Tutorial_commainit_01b.cpp
+ |
+
+\verbinclude Tutorial_commainit_01b.out
+ |
+
\section TutorialAdvancedInitializationSpecialMatrices Special matrices and arrays
diff --git a/doc/snippets/Tutorial_AdvancedInitialization_Join.cpp b/doc/snippets/Tutorial_AdvancedInitialization_Join.cpp
new file mode 100644
index 000000000..84e8715cb
--- /dev/null
+++ b/doc/snippets/Tutorial_AdvancedInitialization_Join.cpp
@@ -0,0 +1,11 @@
+RowVectorXd vec1(3);
+vec1 << 1, 2, 3;
+std::cout << "vec1 = " << vec1 << std::endl;
+
+RowVectorXd vec2(4);
+vec2 << 1, 4, 9, 16;;
+std::cout << "vec2 = " << vec2 << std::endl;
+
+RowVectorXd joined(7);
+joined << vec1, vec2;
+std::cout << "joined = " << joined << std::endl;