Can anyone explain how to this codes generated from neural network???how to apply this code in arduino ide??

3 views (last 30 days)
/* This automatically generated example C main file shows how to call / / entry-point functions that MATLAB Coder generated. You must customize / / this file for your application. Do not modify this file directly. / / Instead, make a copy of this file, modify it, and integrate it into / / your development environment. / / / / This file initializes entry-point function arguments to a default / / size and value before calling the entry-point functions. It does / / not store or use any values returned from the entry-point functions. / / If necessary, it does pre-allocate memory for returned values. / / You can use this file as a starting point for a main function that / / you can deploy in your application. / / / / After you copy the file, and before you deploy it, you must make the / / following changes: / / * For variable-size function arguments, change the example sizes to / / the sizes that your application requires. / / * Change the example values of function arguments to the values that / / your application requires. / / * If the entry-point functions return values, store these values or / / otherwise use them as required by your application. / / */
#include "rt_nonfinite.h" #include "predictActivityFromSignalBuffer.h" #include "main.h" #include "predictActivityFromSignalBuffer_terminate.h" #include "predictActivityFromSignalBuffer_initialize.h"
static void argInit_128x3_real_T(double result[384]); static void argInit_1x66_real_T(double result[66]); static double argInit_real_T(void); static void main_predictActivityFromSignalBuffer(void);
/* Function Definitions */
/* * Arguments : double result[384] * Return Type : void */ static void argInit_128x3_real_T(double result[384]) { int idx0; int idx1;
/* Loop over the array to initialize each element. */
for (idx0 = 0; idx0 < 128; idx0++) {
for (idx1 = 0; idx1 < 3; idx1++) {
/* Set the value of the array element.
Change this value to the value that the application requires. */
result[idx0 + (idx1 << 7)] = argInit_real_T();
}
}
}
/* * Arguments : double result[66] * Return Type : void */ static void argInit_1x66_real_T(double result[66]) { int idx1;
/* Loop over the array to initialize each element. */
for (idx1 = 0; idx1 < 66; idx1++) {
/* Set the value of the array element.
Change this value to the value that the application requires. */
result[idx1] = argInit_real_T();
}
}
/* * Arguments : void * Return Type : double */ static double argInit_real_T(void) { return 0.0; }
/* * Arguments : void * Return Type : void */ static void main_predictActivityFromSignalBuffer(void) { double dv11[384]; double dv12[66]; double dv13[66]; double predictedActid;
/* Initialize function 'predictActivityFromSignalBuffer' input arguments. */
/* Initialize function input argument 'at'. */
/* Initialize function input argument 'fmean'. */
/* Initialize function input argument 'fstd'. */
/* Call the entry-point 'predictActivityFromSignalBuffer'. */
argInit_128x3_real_T(dv11);
argInit_1x66_real_T(dv12);
argInit_1x66_real_T(dv13);
predictedActid = predictActivityFromSignalBuffer(dv11, argInit_real_T(), dv12,
dv13);
}
/* * Arguments : int argc * const char * const argv[] * Return Type : int */ int main(int argc, const char * const argv[]) { (void)argc; (void)argv;
/* Initialize the application.
You do not need to do this more than one time. */
predictActivityFromSignalBuffer_initialize();
/* Invoke the entry-point functions.
You can call entry-point functions multiple times. */
main_predictActivityFromSignalBuffer();
/* Terminate the application.
You do not need to do this more than one time. */
predictActivityFromSignalBuffer_terminate();
return 0;
}
/* * File trailer for main.c * * [EOF] */

Answers (2)

Tony Mohan Varghese
Tony Mohan Varghese on 22 Mar 2018
You can use MATLAB Function block in Simulink and use Simulink support package for Arduino to deploy the generated code to the board.

Rahul punk
Rahul punk on 16 Sep 2020
Edited: Rahul punk on 16 Sep 2020
yes it is possible, you can convert Matlab code to c++ or c using Matlab coder, after convert then download and create Arduino library using c++ and c and arduino main file name_.ino that file link with your all code for exame
many more projects visit
https://yawot.com/

Community Treasure Hunt

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

Start Hunting!