How i can speed up my Windows standalone application which slower than my program in Matlab ?

12 views (last 30 days)
Hi everyone,
I'm run a program to communicate with an external device by a serial communication in Matlab. When i test it, it is working instantly.
Then i created a Windows standalone application and it takes more than 13 seconds to run.
Normally having created the windows standalone application is not expected to accelerate the program? Any idea to speed up or fix it ?
Below is my code with the serial communication i run in matlab :
function [VOR_freq,Distance]= remote_programv2 (filename, com_port)
while 1
%%Open serial port
ser=serial(com_port);
fopen(ser);
if true
% code
end
%%Open abd read file (1st line: Frequency, 2nd line: Distance, 3rd line:Distance)
fid=fopen(filename);
A = fscanf(fid, '%f');
fclose(fid);
%%Calculate Channel
VOR_freq= A(1);
Distance= A(2);
% Mode=A(3);
%%Configure IF6000
%launching the test
fprintf(ser,':DME:MEAS:START')
fprintf(ser,['DME:FREQ:VOR ' num2str(VOR_freq)])
fprintf(ser,['DME:RANG ' num2str(Distance)])
pause(3)
%%clear Objects
fclose(ser)
clear obj
end
end
Thanks you for your answers

Accepted Answer

Image Analyst
Image Analyst on 18 Sep 2013
Compiled programs will need to load the MCR library. I called Mathworks technical support and asked about this already. Apparently there is no way to "pre-load" this library (say, on computer boot up) to speed up launching of your program.

More Answers (1)

elbaz samuel
elbaz samuel on 19 Sep 2013
Ok thanks you very much for your answer Image Analyst. I'll stay with this result.

Categories

Find more on Communications Toolbox in Help Center and File Exchange

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!