can not update MATLAB initial conditons when using BCVTB coupling EP+ and MATLAB

Hi all.

I am using BCVTB for linking EP+ and Matlab(control signal)

currently, I am facing a problem. after the first run of the system, the initial conditions set up in MATLAB is not changing anymore.

In MATLAB initialisation section, I wrote an small function myself to assign value of one variable's initial value, after first run, it seems to be fixed at the same value for next simulation.

It happens in IDF file, which I know I have to deleted some related files if I have to update the IDF for a new run, looks like the same issues here, however, I tried to deleted some files created by MATLAB, seems not working for this issues.

Pdemand_10mins will be used as a condition check in later stage, however, after first simulation, it sticks with a fixed value.

I had a detail look at this issues, I found out that it looks like BCVTB limited the random number generated from initialisation part, unless you have another random function generates random number before

 [Pdemand_10mins, PSOC_10mins] = EV_demand_generation_1();


otherwise, it will be exactly the same random number every time when we simulate.

Any possible ways we could solve this issues?

% Initialize model variables
delTim    = 600;  % time step %10 min
HeatingSystemStatus = 1;
Electricity = zeros(144,1);
InputsFromEP = [0 0]; % 2 variables 1. electricity from house 2. indoor temp.

% Initialize flags
retVal    = 0;
flaWri    = 0;
flaRea    = 0;
simTimWri = 600;% time step %10 min
simTimRea = 0;

[Pdemand_10mins, PSOC_10mins] = EV_demand_generation_1();
filename_1 ='SOC.csv';
csvwrite(filename_1,PSOC_10mins);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Add path to BCVTB matlab libraries