필터 지우기
필터 지우기

Variables scope in MatLab function block

조회 수: 4 (최근 30일)
Tamim Boubou
Tamim Boubou 2021년 2월 22일
댓글: Tamim Boubou 2021년 2월 25일
Hello everyone,
I have a simulink file, in which I'm using a matlabFunction block, this function is calling several other functions and files including some structures in the same path, but whenever I run the simulation, the variables that are defined in the workSpace are not visible for the "matlab function" block, is there any way of changing their scope or any approach to fix this other than having to re-define all the variables locally within that block?

채택된 답변

Fangjun Jiang
Fangjun Jiang 2021년 2월 22일
Use "Edit Data" in the MATLAB Function Editor to specify those base workspace variables as the parameters
  댓글 수: 1
Tamim Boubou
Tamim Boubou 2021년 2월 25일
Thank you!, I didn't know of this method before.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Simulink Functions에 대해 자세히 알아보기

제품


릴리스

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by