[de14c2]: / @mp / private / precAndSize.m  Maximize  Restore  History

Download this file

29 lines (25 with data), 652 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
if (isa (x, 'mp'))
precision = x(1).precision;
if (~isa (y, 'mp'))
y = mp(y, precision);
end
else
precision = y(1).precision;
x = mp (x, precision);
end
[sx, sy] = deal (size (x), size (y));
[ex, ey] = deal (prod (sx), prod (sy));
if (~all (sx == sy))
if (~(1 == length(x) | 1 == length(y)))
disp (['size of matrix 1 => ', num2str(sx(1)), 'x', num2str(sx(2))]);
disp (['size of matrix 2 => ', num2str(sy(1)), 'x', num2str(sy(2))]);
error (['Size mismatch for mp objects']);
end
end
if (ex >= ey)
[out_rval, out_ival] = deal (cell (sx));
outn = zeros (sx);
else
[out_rval, out_ival] = deal (cell (sy));
outn = zeros (sy);
end