フィルターのクリア

Coder Cannot define entrypoint for classdef

4 ビュー (過去 30 日間)
Peter B
Peter B 2015 年 10 月 19 日
コメント済み: Peter B 2015 年 11 月 20 日
Im currently testing the matlab coder, sins we are looking to move our matlab projects into C for performance and integrating with a larger system. Most of our current codebase uses classdef's below is a simple example of what we are using.
classdef MeanAgent < handle
properties
d_Vec
sName
dEMA
end
methods
function this = MeanAgent( sName )
this.sName = sName;
this.dEMA = 0;
this.d_Vec = [];
end
function m = MeanOfNothing(this,dVal)
this.d_Vec = [this.d_Vec dVal];
m = mean(this.d_Vec);
end
end
end
When trying to generate code using the Coder, i get either stuck when asked to define input types, not being able to press next.
or im presented with the error:
matlab All entry-point files must be functions. MeanAgent.m is a class.
if i select "determin imputtype from codeprecondition.
Is the conversion just not possible, or how does the coder support classdef, i havnt managed to find this in any of your examples.

採用された回答

Arnab De
Arnab De 2015 年 11 月 20 日
The entry point to MATLAB Coder must be a function. MATLAB classes are not supported as entry points. You can define a function that uses the MATLAB class and use it as an entry point.
  1 件のコメント
Peter B
Peter B 2015 年 11 月 20 日
Thanks for the reply, I managed to work around the issue using structs as input in conjunction with reentrant functions, keeping the number of parameters for my functions to a minimum.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMATLAB Coder についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by