Calling .mat file into function
조회 수: 21 (최근 30일)
이전 댓글 표시
Hi I have a question about calling contents of a .mat file into function. for example you save some matrices into .mat file and now you want to calling them into function.
How can do it please?
댓글 수: 0
답변 (2개)
Geoff Hayes
2014년 12월 9일
편집: Geoff Hayes
2014년 12월 9일
댓글 수: 2
Geoff Hayes
2014년 12월 9일
Fatema - I don't understand what you mean by it is needed to load my .mat file from command window before. Why not assign, in your function, the result of the load to a structure as
data = load('test.mat');
And, what is the purpose of the evalin call?
Pablo Díez
2020년 3월 21일
You can extract the variable which you want from the model workspace doing the following in a Matlab Function block:
coder.extrinsic('get_param','getVariable');
mdlWks = get_param('your_model.slx','ModelWorkspace');
variable= getVariable(mdlWks,'variable_name');
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Manage Design Data에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!