Read data in matlab functions for protected model Simulink

조회 수: 4 (최근 30일)
Mathieu Gauquelin
Mathieu Gauquelin 2021년 8월 27일
댓글: Mathieu Gauquelin 2021년 9월 2일
Hello,
I developped a Simulink model in which I call some Matlab function block. In these ones, I need to use some functions such as pwd or xlsread to read an entire xlsx/csv file once and get some table to use in matlab function later.
But I also need to protect my model and to use these functions I need to pass through :
coder.extrinsic
But it is not supported for the code generation.
Is there a easy way to fix this ? I didn't find a Simulink block to get some information such as the path of the executed model, and any other reading function has the same problem as xlsread.
Thank you very much in advance for your help.
Best regards.
  댓글 수: 12
Walter Roberson
Walter Roberson 2021년 9월 2일
You tell me that the load() function is not compatible to be used during a simulation ?
No, I am telling you that the documentation says that you can use load() of a .mat file at run-time, and that the file can vary (though you do need to take care about which directory to look in for the file.)
I have no information about how any of this interacts with protect()
Mathieu Gauquelin
Mathieu Gauquelin 2021년 9월 2일
Ok thank you. I succeed to protect my model using coder.load finally, with a constant file in input. How to accept one of your comment as answer ?

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

답변 (0개)

카테고리

Help CenterFile Exchange에서 Configure and View Diagnostics에 대해 자세히 알아보기

제품


릴리스

R2016b

Community Treasure Hunt

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

Start Hunting!

Translated by