Open in the MATLAB editor: f01va_example
function f01va_example fprintf('f01va example results\n\n'); uplo = 'u'; a = [1.1, 1.2, 1.3, 1.4; 0.0, 2.2, 2.3, 2.4; 0.0, 0.0, 3.3, 3.4; 0.0, 0.0, 0.0, 4.4]; % Print the unpacked matrix fprintf('\n'); [ifail] = x04cb(uplo, 'n', a, 'f5.2', 'Unpacked matrix a:', 'i', ... {''}, 'i', {''}, int64(80), int64(0)); % Convert to packed vector form [ap, info] = f01va(uplo, a); % Print the packed vector fprintf('\n'); [ifail] = x04cb('g', 'x', ap, 'f5.2', 'Packed matrix ap:', 'i', ... {''}, 'n', {''}, int64(80), int64(0));
f01va example results Unpacked matrix a: 1 2 3 4 1 1.10 1.20 1.30 1.40 2 2.20 2.30 2.40 3 3.30 3.40 4 4.40 Packed matrix ap: 1 1.10 2 1.20 3 2.20 4 1.30 5 2.30 6 3.30 7 1.40 8 2.40 9 3.40 10 4.40