Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
dlib
Commits
5dace981
Commit
5dace981
authored
Jul 08, 2013
by
Davis King
Browse files
Updated matrix example to show how to print in csv format.
parent
11756238
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
0 deletions
+18
-0
examples/matrix_ex.cpp
examples/matrix_ex.cpp
+18
-0
No files found.
examples/matrix_ex.cpp
View file @
5dace981
...
@@ -121,6 +121,24 @@ int main()
...
@@ -121,6 +121,24 @@ int main()
// The above expression prints out the value 1.2
// The above expression prints out the value 1.2
// Note that you can always print a matrix to an output stream by saying:
cout
<<
M
<<
endl
;
// which will print:
// 54.2 7.4 12.1
// 1 2 3
// 5.9 0.05 1
// However, if you want to print using comma separators instead of spaces you can say:
cout
<<
csv
<<
M
<<
endl
;
// and you will instead get this as output:
// 54.2, 7.4, 12.1
// 1, 2, 3
// 5.9, 0.05, 1
// Conversely, you can also read in a matrix that uses either space, tab, or comma
// separated values by uncommenting the following:
// cin >> M;
// ----------------------------- Comparison with MATLAB ------------------------------
// ----------------------------- Comparison with MATLAB ------------------------------
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment