I have a Simulink Parameter Object, and I would like to copy this variable by value. When I execute the following code, I note that the copy I make using the "=" (equals) operator is actually a copy by reference:
a=Simulink.Parameter; % create a parameter object
a.Value=5; % set a value
b=a; % copy by reference
b.Value=10; % change the value in the copy
% Now, note that the value in the original has also changed.
a.Value
Best Answer