How to use griddata in simulink's matlab function block?

13 ビュー (過去 30 日間)
manoj saladi
manoj saladi 2019 年 4 月 28 日
コメント済み: Walter Roberson 2019 年 4 月 30 日
Hi,
I want to use griddata in simulink's matlab function block. But when I do this I saw error statements in Simulink as shown below
  • 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.
Can anyone tell me what would be the problem
Thank you,
Manoj.

採用された回答

Walter Roberson
Walter Roberson 2019 年 4 月 28 日
You can turn all acceleration off so that it does not attempt to generate code.
You can turn acceleration to the next lowest level, and put the line
coder.extrinsic('griddata');
in your code near the top. Code will be generated and will be able to call into matlab.
For any higher level of acceleration you would need to rewrite the code to not call griddata.
  4 件のコメント
manoj saladi
manoj saladi 2019 年 4 月 29 日
Hi, when I intialize the variable for example like: isdref=zeros(100,1);
simulink showed me the following error.
Caused by:
  • Size mismatch for MATLAB expression 'griddata'. Expected = 1x100 Actual = 1x1
But when I intialized the variable like isdref=zeros(1,1) the model is working, but it doesn't give correct result.
Walter Roberson
Walter Roberson 2019 年 4 月 30 日
See coder.varsize()

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSimulink Functions についてさらに検索

製品


リリース

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by