How do I save MATLAB data for a C/C++ based embedded system?
5 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Yang Renda
el 6 de Feb. de 2024
Comentada: Yang Renda
el 7 de Feb. de 2024
Say that I have used MATLAB coder to create multiple C codes that I shall apply on an STM32.
The C codes take a lot of parameters as input, and I do not want to write data as header files, nor do I want to write a program to do that, not if there are existing solutions, or better alternatives.
The application does not call for the need of a single board computer, and STM32 cannot store nor read .mat files (I think).
What are my options?
0 comentarios
Respuesta aceptada
Sumit Ghosh
el 7 de Feb. de 2024
You can achieve this using coder.read and coder.write.
In short, coder.write(fileName,data) stores the argument data in a file with the name fileName.coderdata in your current directory. You can use this function in your host machine to sae the paraleters in a file.
dataFromFile = coder.read(fileName) reads from the fileName.coderdata storage file and returns the data stored within the file. You can use this function in your MATLAB® code for which you want to generate C/C++ code. The generated code performs the data read at run time.
2 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre STMicroelectronics Discovery Boards en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!