0
En revisión

It is possible to use mp computations in a simulink block or S-function ?

JLD95 hace 5 años actualizado por Pavel Holoborodko hace 5 años 1

I would like a simulink block which have double precision floating point in input and output but internal computations in this block are made in quadruple precision: it is possible to use with MP Toolbox ?

En revisión

This is definitely possible with usual MATLAB functions, e.g.:

function F = mpfun(x)
        x = mp(x)      % convert input to 'mp'
        ...            % compute F using 'mp'
        F = double(F)  % return 'double'
end

S-function is complied MEX module and it cannot use "mp" objects directly in C/C++ code.

But you can put 'mp'-related code to separate MATLAB function (like above) and call it from within MEX/S-function using mexCallMATLABWithTrap or mexCallMATLAB.