Updated the matrix example.

--HG--
extra : convert_revision : svn%3Afdd8eb12-d10e-0410-9acb-85c331704f74/trunk%402718
This commit is contained in:
Davis King 2008-12-11 03:13:46 +00:00
parent 1d2ecc9d4b
commit f2f4e57497
1 changed files with 9 additions and 7 deletions

View File

@ -58,13 +58,13 @@ int main()
// now we need to initialize the y and M matrices and we can do so like this:
M << 54.2, 7.4, 12.1,
1, 2, 3,
5.9, 0.05, 1;
M = 54.2, 7.4, 12.1,
1, 2, 3,
5.9, 0.05, 1;
y << 3.5,
1.2,
7.8;
y = 3.5,
1.2,
7.8;
// the solution can be obtained now by multiplying the inverse of M with y
@ -198,9 +198,11 @@ int main()
A = subm(B, range(0,2), range(0,2,3));
// MATLAB: B(:,:) = 5
set_subm(B,get_rect(B)) = 5;
B = 5;
// or equivalently
set_all_elements(B,5);
// or equivalently
set_subm(B,get_rect(B)) = 5;
// MATLAB: B([1:2],[1,2]) = 7