0
На рассмотрении

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

JLD95 5 лет назад обновлен Pavel Holoborodko 5 лет назад 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 ?

На рассмотрении

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.

Сервис поддержки клиентов работает на платформе UserEcho