필터 지우기
필터 지우기

How to declare global variables for simulink containing matlab functions?

조회 수: 2 (최근 30일)
HJ Jay
HJ Jay 2015년 5월 25일
댓글: Nathan Huntoon 2015년 8월 10일
I'm building a simulink model with multiple matlab function blocks( http://in.mathworks.com/help/simulink/slref/matlabfunction.html ). Each of these function blocks have a lot of constants, for example (g=9.8), common between them. I want to initialize all of these constants in one go so that I don't have to do so in each function block.
I tried initialising all the variables in matlab workspace, but they don't seem to be working.
What is the best and easiest way to go forward with this?

답변 (1개)

Azzi Abdelmalek
Azzi Abdelmalek 2015년 5월 25일
  댓글 수: 2
HJ Jay
HJ Jay 2015년 5월 27일
Not exactly what I want. I want all my parameters to be initialized by using a .m file. How can I get all of these data from the matlab workspace to the matlab function block workspaces in simulink?
Nathan Huntoon
Nathan Huntoon 2015년 8월 10일
Did you ever figure this out? I'm also trying to get global data into multiple matlab function blocks inside a model. In my case, I want to have each of the function blocks update the same figure, and I'm trying to pass the figure handle.

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

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by