Same variable names in different level2 s-functions or multiple instances of same level2 s-function will be stored separately?
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
ayyappa rudrasimha yedida
el 20 de Dic. de 2020
Editada: ayyappa rudrasimha yedida
el 20 de Dic. de 2020
Hi,
I am writing level 2 s functions for c code and I am using the same s function multiple instances or I will make different named s-functions with the same code. I am defining variables inside the s-functions with same name (Like i,j). The variables values will be different for different s-functions or each instance of s-function. Will there be any conflict between variables since it is with same name in multiple s-functions or will it be treated as diffrent varaibles?
% s-function1 code%
#define S_FUNCTION_NAME test
#define S_FUNCTION_LEVEL 2
#include "simstruc.h"
float i=0,j=0;
static void mdlInitializeSizes(SimStruct *S)
{
....
%s-function2 code%
#define S_FUNCTION_NAME test1
#define S_FUNCTION_LEVEL 2
#include "simstruc.h"
float i=0,j=0;
static void mdlInitializeSizes(SimStruct *S)
{
....
Thanks,
0 comentarios
Respuestas (0)
Ver también
Categorías
Más información sobre Verification, Validation, and Test en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!