Mex function Implementation for nested-functions
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
sree
el 23 de Nov. de 2023
Comentada: sree
el 29 de Nov. de 2023
Hello,
We are trying to implement mex function for a nested function code.
We have a main function , addition()
We have another function - multiplication() which is getting called from addition function.
Also, we have another function division() which is getting called from multiplication function.
We have mexFunction written inside addition.c and getting the below error after executing the matlab file.
Error using mex
/usr/bin/ld: /tmp/mex_3689884132576332_19/addition.o: in function `addition':
addition.c:(.text+0x49): undefined reference to `multiplication'
We are attaching the screenshot for your reference.![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1550322/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1550322/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1550327/image.png)
We have declared multiplication and division functions inside commonheader.h file.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1550332/image.png)
We have function definitions for multiplication and division functions in operation.c.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1550337/image.png)
Please let us know if we are missing anything in implementing this mex -nested function.
Thank you
Sreelakshmi
0 comentarios
Respuesta aceptada
Más respuestas (0)
Ver también
Categorías
Más información sobre Write C Functions Callable from MATLAB (MEX Files) 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!