Enter forum description here ...
0
Answered

Is there a mp-version of Matlab's function 'eps' ?

Roland K 8 years ago updated by Denis Tkachenko 7 years ago 4
0
Completed

Error using pinv

Hector 8 years ago updated by Pavel Holoborodko 8 years ago 8

??? Error using ==> mp>mp.pinv at 2964

DGESSD failed with exit code = 4
Error in ==> LM_Rtc at 77
s=pinv(a)*b
0
Answered

Extremely slow interp1

m b 8 years ago updated by Pavel Holoborodko 8 years ago 4

Hi,

Could you please advise why interp1 with mp is so slow compared to original matlab interp1? belwo is the example I'm running. Thank you for your kind help

mohsen


% Grid length and useful vectors
N = 200;
kp = mp(linspace(1e-6,5,N))';
n = mp( ones(1,2)); nn = mp(ones(N,1));


% parameters & given values
gam = 2; beta = 0.96;
R = 1.05; w0 = 3.44;
prob = mp([0.9500, 0.0500; 0.6750, 0.3250]);


w = mp(sort( w0*( .995 + randn(N,1)/7.5 ) ));
W = [w, 0*nn];


% initialize
Cp = mp(R)*kp*n; k = Cp;


% convergence criterion
Cp_crit = 1;


% Interpolate until convergence
ii = 0; tic

while Cp_crit > 1e-3
Cp0 = Cp;
EMUp = (Cp.^(-mp(gam)))*prob';
C = (mp(beta*R)*EMUp).^(-1/mp(gam));
k = ( kp*n + C - W)/mp(R);

% Use the relation between C and k to ropose a new vector Cp corresponding to kp
for i=1:2
% Update the function by interpolation.
Cp(:,i) = interp1(k(:,i), C(:,i), kp,'linear','extrap');
end

Cp_crit = max(max(abs(Cp0-Cp)./(1+abs(Cp))));
ii = ii+ 1;
end
toc
disp(Cp_crit)


0
Fixed

Bug in relational operations

Michael_ 8 years ago updated by Pavel Holoborodko 8 years ago 3

Hi.

I think there is a bug in the relational operations "equal" and "unequal"


test(:,1)=(1:4)';

testmp=mp(test);


This works:

test==1
ans =
1
0
0
0
testmp==1
ans =
1
0
0
0

This doesn't

1==test
ans =
1
0
0
0
1==testmp
ans =
1


This has worked in previous versions though.

Best regards,

Michael

0
Answered

Larger numbers

Hector 8 years ago updated by Pavel Holoborodko 8 years ago 10

Pavel, there are larger numbers than 1e + 308 and less than 1e-318 ?

0
Completed

use save and load

Hector 8 years ago updated by Pavel Holoborodko 8 years ago 1

how to use the command save and load the data mp ?

more precisely as save sets of objects containing mp elements, then load them ?,

or such as saving array mp text and then load ?

0
Completed

sortrows use

Hector 8 years ago updated by Pavel Holoborodko 8 years ago 6

I have an object X of type 100 x 4 mp

and I want to order it with the command sortrows
the sguiente way:
X = sortRows (X, 4);
but shows error:
Error in ==> sortrows at 74
ndx = sortrowsc(x_sub, col);
Error in ==> A_Var_FijaMP at 9
X=sortrows(X,4));
A_Var_FijaMP.m being my program
0
Completed

As it is done to work with subs ?

Hector 8 years ago updated by Pavel Holoborodko 8 years ago 2

clc

clear all;

%addpath('.....................\Multiprecision Computing Toolbox\')

syms A B C;

T=A+B*C;

mp.Digits(20);

a=37456795;

b=576879678;
c=7888797;

t=subs(T,{'A','B','C'},{a,b,c})

now I want a b c t are multiple precision

0
Not a bug

MSCALE

john doe 8 years ago updated by Pavel Holoborodko 8 years ago 1

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

0
Fixed

COMPLEX (& perhaps ISREAL) method - wrong behavior

john doe 8 years ago updated by Pavel Holoborodko 8 years ago 16

>> c1 = complex(12)
c1 =
12 + 0i

>> isreal(c1)
ans =
0


>> c2 = complex(mp(12))
c2 =
12

>> isreal(c2)
ans =
1