필터 지우기
필터 지우기

Force MATLAB code to run on hardware

조회 수: 2 (최근 30일)
Shehryaar Ali
Shehryaar Ali 2022년 2월 18일
답변: Kiran Kintali 2024년 1월 22일
I have written a code that also uses different function from toolboxes that are not yet supported for code generation in Simulink. It works fine in MATLAB, but I have to use Interpreted MATLAB Functions in Simulink. As it is important, I really want to run it on hardware, is there a workaround to do that?
What I think, is to use some kind of Machine Learning so that I can store the output to the function for each and every input, hence making a dataset. And then apply some ML algorithm which learns it, and thus give accurate results as no input would be unfamiliar, so that it can be implemented in Simulink without interpretation and then on Hardware. Is it possible?
  댓글 수: 2
Steven Lord
Steven Lord 2022년 2월 18일
What functions does your code use that are not yet supported for code generation in Simulink?
Shehryaar Ali
Shehryaar Ali 2022년 4월 6일
Sorry for late reply, but these function are primarily from Optimization Toolbox.

댓글을 달려면 로그인하십시오.

답변 (2개)

Ashutosh Thakur
Ashutosh Thakur 2024년 1월 22일
Hi Shehryaar,
In order to deploy a Machine Learning model on hardware which contains function from toolboxes which are not supported for code generation, Kindly follow the below mentioned suggestions while deploying the MATLAB code in hardware:
  • After training the model on the dataset, the next step is to convert it into target language code this could be C/C++.
  • Since you have a working MATLAB code, I suggest you to use MATLAB Coder product to convert the MATLAB code to C++ code. Kindly note that MATLAB Coder too have difficulty is producing code for some MATLAB functions so before using MATLAB code make sure that the functions present in MATLAB code are supported or not, the list of unsupported functions can be found in the following link: https://www.mathworks.com/help/compiler/unsupported-functions.html.
  • Deep Learning Toolbox product can also be used to train a model and generate code depending on the target hardware. It supports the generation of C/C++, CUDA or HDL code for the model.
Please take reference from the following documentation links regarding The MATLAB Coder and Deep Learning Toolbox:
I hope the above mentioned suggestions and links helped you in deploying the code in hardware.

Kiran Kintali
Kiran Kintali 2024년 1월 22일
Please share your code / model that you want to generate HDL from.
if you are taking the ML/DL route, please consider https://www.mathworks.com/products/deep-learning-hdl.html
Deep Learning HDL Toolbox
Prototype and deploy deep learning networks on FPGAs and SoCs

카테고리

Help CenterFile Exchange에서 Deep Learning with GPU Coder에 대해 자세히 알아보기

제품


릴리스

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by