Matlab coder and categorical data type

Hi,
I'm trying to deploy a classification project on Arduino Nicla Sense Me board, but the categorical data type is a problem.
I have created a classification model with Matlab Classification learner and then generated C code with Matlab Coder. In the model there is used a data type categorical and I don't know how to use it in Arduino IDE. The data that has this data type is the result of the classification.

Any ideas?
Regards, Bosse

You could perhaps use an integer? E.g., 1 means category A, 2 means category B, etc.

Look for ENUM. That can 'map' a category to an int.

Hi,
I've tried both but no luck.
Here in the pic is the format of the categorical:

It is two rows and contains 11 chars (two words)
Arduino IEC only replies that it cannot convert from categorical to ...

Regards, Bosse

Please post the generated C code, using code tags. I imagine it defines a struct.

So you want to run the C code produced by matlab on your microcontroller?

Yes!
/B

You really need to publish the C generated code here. It might very well contain bits that are not supported by the Arduino dialect of C. In fact I should say C++ here, but most C is valid in C++ as well.
Maybe there will be a quick fix, maybe it will be impossible to fix ...

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.