Open in the MATLAB editor: f01ve_example
function f01ve_example fprintf('f01ve example results\n\n'); uplo = 'u'; transr = 'n'; 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 Rectangular Full Packed form [ar, info] = f01ve(transr, uplo, a); % Print the Rectangular Full Packed array fprintf('\n'); [ifail] = x04cb('g', 'x', ar, 'f5.2', 'RFP Packed Array ar:', 'i', ... {''}, 'n', {''}, int64(80), int64(0)); n = int64(size(a,1)); k = int64(n/2); q = n - k; if transr=='N' || transr=='n' lar1 = 2*k + 1; lar2 = q; else lar1 = q; lar2 = 2*k + 1; end ar = reshape(ar,lar1,lar2); fprintf('\n'); [ifail] = x04cb('g', 'x', ar, 'f5.2', ... 'RFP Packed Array ar (graphical representation):', 'i', ... {''}, 'i', {''}, int64(80), int64(0), 'm', lar1, 'n', lar2);
f01ve 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 RFP Packed Array ar: 1 1.30 2 2.30 3 3.30 4 1.10 5 1.20 6 1.40 7 2.40 8 3.40 9 4.40 10 2.20 RFP Packed Array ar (graphical representation): 1 2 1 1.30 1.40 2 2.30 2.40 3 3.30 3.40 4 1.10 4.40 5 1.20 2.20