MATLAB: Global Flag

flag

Dear All
I am using flag in my code and when I run the code with these set of parameters
HenXoma(1, 9.81, 0.017, 1, 8.8, 15.2, 1, 1, 0, 0, 2, 4, 0, 36.9, 15.2)
I got a solution of 30.2 (this number is just for explaining)
Then When I am changing the fourth input parameter which is =(1) to (0)(lets call this parameter Yw), I got the same solution (30.2). It should be different solution.
After debugging I found that Matlab took the previous value of Yw as (1) not the new value (0). Also I made clear in the command window to ensure that the work space is cleared.but I got the same answer I appreciate any useful suggestion and thanks for your help.

Best Answer

I'd say that Yw is not used, or has no effect, in the internal code of HenXoma (which we can't see because you didn't post it.) Why don't you post it.
If Yw is a global variable (I assume that's what "Glabal" means to you), you don't need to pass it via the argument list, you just declare it global inside the function.