Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

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

Asked by elbaz samuel on 18 Sep 2013

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

0 Comments

elbaz samuel

Products

2 Answers

Answer by Image Analyst on 18 Sep 2013
Accepted answer

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.

0 Comments

Image Analyst
Answer by elbaz samuel on 19 Sep 2013

Ok thanks you very much for your answer Image Analyst. I'll stay with this result.

0 Comments

elbaz samuel

Contact us