Simulink interpolation using 4 different vectors

6 vues (au cours des 30 derniers jours)
Brasco , D.
Brasco , D. le 17 Fév 2015
HI guys i got a problem about interpolation in simulink.
I got 4 variables( each 200x1) . Lets call tehm A,B,C and D.
A,B,C,D are related with each other. I need to interpolate D for a given set of A,B,C.
I can do it in matlab. ( Dq=griddata(A,B,C,D,Aq,Bq,Cq) ) . But i can not do it in simulink.
I tried to use matlab fuction block but it gives me an error "The function 'griddata' is not supported for standalone code generation. See the documentation for coder.extrinsic to learn how you can use this function in simulation." and "Simulink does not have enough information to determine output sizes for this block. If you think the errors below are inaccurate, try specifying types for the block inputs and/or sizes for the block outputs."
can anyone help me?

Réponses (1)

A Jenkins
A Jenkins le 17 Fév 2015
As it says,
(1) use coder.extrinsic to add support for griddata
(2) Specifiy the size of the output data of your block.
.....
function vq = fcn(x,y,v,xq,yq)
coder.extrinsic('griddata'); %(1)
vq = zeros(size(xq)); %(2)
vq = griddata(x,y,v,xq,yq);

Catégories

En savoir plus sur Simulink Functions dans Help Center et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by