Hi all,
I have been trying to find the reason for observations I have made
regarding MCC compiled code.
My test function looks like:
function [] = test_debug(num_sim)
num_sim = str2num(num_sim);
num_inputs = 2;
for index = 1:num_sim
disp('Start of Simulation');
tic;
input_block = (rand(1,520*8) > 0.5);
for idx = 1:length(input_block)/num_inputs
temp = input_block((idx-1)*num_inputs+1:idx*num_inputs) *
2.^[num_inputs-1:-1:0].';
end
disp(sprintf('End of Simulation Count %d',index));
toc;
end
return;
I have compiled it using :
mcc -v -x -B sgl -d ./Temp test_debug -o ../../Executable/test_debug
I ran the created executable from DOS prompt using
test_debug 5
All the iterations gave me increasing simulation time.
Then I replaced the statement in the for loop:
temp = input_block((idx-1)*num_inputs+1:idx*num_inputs) *
2.^[num_inputs-1:-1:0].';
with
x = 2.^[num_inputs-1:-1:0].';
temp = input_block((idx-1)*num_inputs+1:idx*num_inputs) * x;
Now it gave be uniform simulation time for each iteration in the
executable run. However While if I run this code in Matlab command
prompt both runs equally well. It is expected (a known ) issue??
Thanks and Regards,
Amit Shaw
**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
h...@ittiam.com.
**********************************************************************