Simulink interpolation using 4 different vectors

6 ビュー (過去 30 日間)
Brasco , D.
Brasco , D. 2015 年 2 月 17 日
回答済み: A Jenkins 2015 年 2 月 17 日
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 Center および File ExchangeSimulink Functions についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by