Commit cceadf37 authored by Davis King's avatar Davis King

Updated matrix example.

--HG--
extra : convert_revision : svn%3Afdd8eb12-d10e-0410-9acb-85c331704f74/trunk%402898
parent 484d5103
......@@ -140,6 +140,9 @@ int main()
// MATLAB: B = ones(3,4)
B = uniform_matrix<double>(3,4, 1);
// MATLAB: B = rand(3,4)
B = randm(3,4);
// MATLAB: C = 1.4*A
C = 1.4*A;
......@@ -186,14 +189,11 @@ int main()
// MATLAB: A = B(:,1)
A = colm(B,0);
// MATLAB: A = [1:5]'
Blong = range(1,5);
// MATLAB: A = [1:5]
Blong = trans(range(1,5));
Blong = range(1,5);
// MATLAB: A = [1:2:5]
Blong = trans(range(1,2,5));
Blong = range(1,2,5);
// MATLAB: A = B([1:3], [1:2])
A = subm(B, range(0,2), range(0,1));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment