Simulink interpolation using 4 different vectors

1 次查看(过去 30 天)
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?

回答(1 个)

A Jenkins
A Jenkins 2015-2-17
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);

类别

Help CenterFile Exchange 中查找有关 Simulink Functions 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by