nag_matop_real_gen_trans_inplace (f01cr) requires that the elements of an
by
matrix
are stored consecutively by columns in a one-dimensional array. It reorders the elements so that on exit the array holds the transpose of
stored in the same way. For example, if
and
, on entry the array must hold:
and on exit it holds
Exact results are produced.
function f01cr_example
fprintf('f01cr example results\n\n');
a = [ 1 2 3 4 5 6 7;
8 9 10 11 12 13 14;
15 16 17 18 19 20 21];
[m,n] = size(a);
[atrans, ifail] = f01cr(a, int64(m), int64(n));
atrans = reshape(atrans,[n,m]);
disp('Transpose of A');
disp(atrans);