Hello,
I was having an issue when using functions in Compose. I would like to explain the issue with a simple example as shown below.
I created the function below in Compose:
function [a,b,c,d] = trial1(x,y,z)
a=2; b=5; c=x+y; d=x/a;
end
I saved the file with the name 'trial1.oml'
Then, in the command window, I typed
[a,b,c,d] = trial1(6,12,20)
Compose returned the following results as expected:
a = 2
b = 60
c = 18
d = 3
Then, I modified the function as follows and I saved the file:
function [a,b,c,d] = trial1(x,y,z)
a=x+z; b=y*z; c=x+y; d=x/a;
end
Please note that the expression for outputs a and b have changed. According to the new function, a should be 26 and b should be 240. The I run the same line in the command window:
[a,b,c,d] = trial1(6,12,20)
And I get the following results:
a = 2
b = 60
c = 18
d = 3
which are the same as the previous ones. When I restart compose and run the same line in the command window, I get the right results for the updated function.
a = 26
b = 240
c = 18
d = 0.230769231
It seems like the changes I make in the function do not take place immediately. Could you please help me with this?
Thank you
Berker