Borrar filtros
Borrar filtros

C Caller does not show port specification?

1 visualización (últimos 30 días)
SimTec
SimTec el 13 de Sept. de 2021
Hello,
as You can see C caller does not show Port specification of the c code of the MatLab video shown here:https://www.youtube.com/watch?v=ONrb_UYTWYs&ab_channel=MATLAB
#ifndef HEADER_H_
#define HEADER_H_
// Global Variable
extern double gVec[5];
extern double sum;
//Function
extern void cumulativeAdder(void);
#endif
source code
#include "header.h"
double gVec[5];
double sum = 0;
void cumulativeAdder(void){
int idx = 0, tmpSum = 0;
for(; idx < 5, ++idx){
tmpSum = tmpSum + gVec[idx); // Function reads "gVec" as INPUT
}
sum = tmpSum; //Function writes to "sum" as OUTPUT
}

Respuestas (0)

Categorías

Más información sobre Simulink Functions en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by