
As it is done to work with subs ?
clc
%addpath('.....................\Multiprecision Computing Toolbox\')
syms A B C;
T=A+B*C;
mp.Digits(20);
a=37456795;
t=subs(T,{'A','B','C'},{a,b,c})
now I want a b c t are multiple precision

MSCALE
M = [ 1.4334 0.7382 1.8723;
0.7298 0.1605 3.0624;
2.7983 1.5972 0.5769];
[s,p] = mscale(mp(M), 'safebal', 'perm');
In an assignment A(:) = B, the number of elements in A and B must be the same.
Error in mpmscale

COMPLEX (& perhaps ISREAL) method - wrong behavior
>> c1 = complex(12)
c1 =
12 + 0i
>> isreal(c1)
ans =
0
>> c2 = complex(mp(12))
c2 =
12
>> isreal(c2)
ans =
1

'OverrideDoubleBasicArrays' option and 'double' method
Reason why someone would activate the option "OverrideDoubleBasicArrays" is to work with the desired precision (superior to that offered by type "double").
On the other hand, in "classic" Matlab, no one uses the builtin function "double" with explicit intentionality to reduce the precision for data (most often on the contrary).
In order to shoot not themselves in the foot I suggest altering the method "double" like this:
if ~(mp.OverrideDoubleBasicArrays && ismp(x))
r = mpimpl(402,x); else r = x; end

toolbox updater tool - a elementary implementation
the intuition tells me that in the very near future this tool will be very useful; It seems that Pavel prepares a lot of updates (very pleasing, I think)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% function advanpix_update() % check for a newer version than the locally installed, % download the new version and then launches the installer v = sscanf (version, '%d.%d.%d') ; % /matlabcentral/fileexchange/17285-getversion v = 10.^(0:-1:-(length(v)-1))*v ; if ~(v>=8.4), disp(' ... this implementation requires Matlab R2014b or newer.') return; end try text = webread('http://www.advanpix.com/download/','Timeout',5); % get version available for download newver = strtrim(strtok(regexprep(text,'.+Download Trial.+Ver.',''),'<')); % get local installed version info = evalc('mp.Info'); text = regexp(info,'Version.*','ignorecase','dotexceptnewline','match'); curver = regexprep(strtrim(regexprep(char(text),'[^0-9.\s]','')),'\s+','.'); if ~strcmp(newver,curver) instdir = winqueryreg('HKEY_CURRENT_USER','Software\Advanpix','InstallDir'); if exist(fullfile(instdir,'download'),'dir')~=7 mkdir(fullfile(instdir,'download')); end Url = 'http://www.advanpix.com/wp-content/plugins/download-monitor/download.php?id=1'; exe_name = ['AdvanpixMCT-',newver,'-Setup.exe']; disp('Try downloading the newest version of the toolbox. Wait, please ...'); % Check for supported Microsoft .NET Framework if NET.isNETSupported disp('Supported .NET Framework not found') % create .Net object to handle the file download NET.addAssembly('System.Net'); client = System.Net.WebClient; installer = fullfile(instdir,'download',exe_name); client.DownloadFile(Url,fullfile(instdir,'download',installer)); else options = weboptions('Timeout',30,'ContentType','binary'); olddir = cd(fullfile(instdir,'download')); try installer = websave(exe_name,Url,options); catch, cd(olddir); end cd(olddir); end % run the installer system(installer); else disp('The latest version of the toolbox is already installed.'); end catch ME rethrow(ME) end end

Real generalized eigenvalue problem
I have a generalized eigenvalue problem Ax = lambda*Bx, where A and B are real multiprecision matrices. I used eig(A,B) and expected that non-real eigenvalues came out in perfectly complex conjugate pairs (because I want to group them in pairs), but this is not the case. I'm not sure this should be considered a bug, or rather a question about whether there is a way to enforce that EIG returns perfectly conjugate pairs when A and B are real mp matrices?
Here is a simple example (tested in MATLAB 2015A and MCT version 3.9.4.10443):
H = [ 2.285927555469414e-03 -9.683344516608315e-03 0 0 ;

CAST method may also be useful to others
current status:
>> a = mp(mprandn(2,1))
b = [0, 1]
a =
0.4334207802637199612271739466794224
-0.2701469591393686343297786869883695
b =
0 1
>> cast(a,'double')
ans =
0.43342
-0.27015
>> cast(a,'like',b)
ans =
0.43342
-0.27015
>> cast(b,'mp')
Error using cast
Unsupported data type for conversion: 'mp'.
>> cast(b,'like',a)
Error using cast
Unsupported data type for conversion: 'mp'.
>> cast(a,'ss')
Error using cast
Unsupported data type for conversion: 'ss'.
with a CAST method like below ...
function r = cast(A,newclass,varargin) %#ok<INUSL>
narginchk(2,3);
if strcmp(newclass,'like')
narginchk(3,3); newclass = class(varargin{1});
end
try r = eval([newclass,'(A)']);
catch, r = eval([newclass,'(double(A))']); end
end
... the new status:
>> cast(b,'mp')
Error using cast
Unsupported data type for conversion: 'mp'.
>> cast(b,'like',a)
ans =
0 1
>> cast(a,'ss')
ans =
d =
u1
y1 0.4334
y2 -0.2701
Static gain.
Of course, my version is incomplete, but enough for me :)
By the way, on what grounds 'mp' inherits not 'double' ?

another case of undocumented syntax
from Version History:
...
[US,TS, Success] = ordschur(...) % three-outputs, with status as last one.
Note:
ORDQZ has the same peculiarity - see GCARE or GDARE code:
[HH,JJ,~,z(perm,:),Success] = ordqz(HH,JJ,q,z,'lhp') % five outputs

chol (~call) again
Please run the following few lines on the last version.
% *** ASSERTIONS *** (This has been incorporated into the documentation in R14SP3):
%
% CHOL expects its input matrix to be symmetric and only looks at the
% upper triangular portion of the matrix.
% CHOL function will return an error if it is only provided with a single
% output argument, and is also given a matrix that is not positive
% definite.
% CHOL function provides an optional second output argument "p" which
% is zero if the matrix is found to be positive definite. If the input
% matrix is not positive definite, then "p" will be a positive integer.
% *** ASSUMPTION ***
% Your implementation uses ?potr routine ...
% >>>>>>>>>> Let's test ...
%% A is scalar
% clc
mp.FollowMatlabNumericFormat(1) % just for convenience
A = mp(9) %#ok<*NOPTS>
R = chol(A) %#ok<*NASGU>
L = chol(A,'lower')
R = chol(A,'upper')
try [L,p] = chol(A,'lower'), catch, fprintf('mp [L,p] = chol(A,''lower'') BOOOM !!!\n\n'),...
[L,p] = chol(double(A),'lower'), fprintf('matlab ok\n\n'), end %#ok<*ASGLU>
try [P,p] = chol(A,'upper'), catch, fprintf('mp [L,p] = chol(A,''upper'') BOOOM !!!\n\n'), ...
[L,p] = chol(double(A),'upper'), fprintf('matlab ok\n\n'), end
%% A is matrix
% clc
A = mprand(4); A = A.'*A;
R = chol(A) %#ok<*NASGU>
L = chol(A,'lower')
R = chol(A,'upper')
try [L,p] = chol(A), catch, fprintf('mp [L,p] = chol(A) BOOOM !!!\n\n'),...
[L,p] = chol(double(A),'lower'), fprintf('matlab ok\n\n'), end %#ok<*ASGLU>
try [L,p] = chol(A,'lower'), catch, fprintf('mp [L,p] = chol(A,''lower'') BOOOM !!!\n\n'),...
[L,p] = chol(double(A),'lower'), fprintf('matlab ok\n\n'), end %#ok<*ASGLU>
try [P,p] = chol(A,'upper'), catch, fprintf('mp [L,p] = chol(A,''upper'') BOOOM !!!\n\n'), ...
[L,p] = chol(double(A),'upper'), fprintf('matlab ok\n\n'), end
%% Why is so important P?
% if your implementation (as I assumed) uses ?potr routine, the value of p will be
% the ?potr's INFO output
% clc
nice = false;
while ~nice
A = rand(4,6);
A = A.'*A;
[~,p] = chol(A);
if p > 2, nice = true; end
end
[L,p] = chol(A)
assert(all(all(L == chol(A(1:p-1,1:p-1)))))
[ma,na] = size(A)
[ma,nl] = size(L)

quad my own function with mp object
Customer support service by UserEcho