why the error 'code generation does not support classes and enumerations in @-directories' is coming during matlab to c conversion?

8 ビュー (過去 30 日間)
I want to convert the below code into c where the output of function called using coder.ceval is of type struct node * .So here I used the concept of classes. I added a dlnode.m file which contains classes definition in @dlnode directory but it is giving the error 'code generation does not support classes and enumerations in @-directories'.
function[x]=algpeak(ecg) %#codegen
len=length(ecg); fs=17; val=floor(0.2*fs);
head=dlnode(1);
head=coder.ceval('findpeaks',ecg,len,NULL,val);
coder.ceval('printf','%lf',head.pks); x=head.pks+10;
Can anyone suggest some solutuion or any alternative to save struct node * type data in Matlab?

回答 (1 件)

Ryan Livingston
Ryan Livingston 2015 年 4 月 27 日
The documentation lists this limitation in the first entry of the table at the preceding link.
Instead of using an @ directory, you can move the class definition into a single file as the workaround on that page suggests.

カテゴリ

Help Center および File ExchangeGenerating Code についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by