0
votes

I am running my test.m file to create variables in my base work space. This is the content of my test.m file :--

a=10;       % define a variable with particular value
b=20;       % define a variable with particular value
c=0;        % define a variable with particular value

In my MATLAB model now i am trying to access the variables a & b. But it is returning me the value zero for both a & b.

I am using a function call generator to trigger a model every 10 msec.

Solver type : Fixed Step
Solver : Discreate(No Continous states)

Why i am not able to access the workspace variables in my simulink model.

Please see the attached print shot.

Matlab model base Workspace

1

1 Answers

0
votes

You are using an Inport and you named it with the variable name but it does not affect the variable to it, it is only a port. Try using the Constant block and set it to your variable name ("a" for example)