Say I have defined X1 = 20 in a script file and ran the script file. So my Workspace has X1=20.
I open up Simulink and create a model where I create a condition. I compare a new variable X2 (X2 = 40) to X1 in Simulink, and if X2 > X1, then set X1 = 40. I noticed that X1 appears to change to 40 in Simulink but not in the Workspace. Why is that?
So what is the actual value of X1 in Matlab? is it 20 or 40 then? or maybe Im not doing something correctly here?
Best Answer