MATLAB Answers


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   
  if true
    % code
%% Open abd read file (1st line: Frequency, 2nd line: Distance, 3rd line:Distance)
A = fscanf(fid, '%f');
%% Calculate Channel
VOR_freq= A(1);
Distance= A(2);
% Mode=A(3);
%% Configure IF6000
%launching the test
fprintf(ser,['DME:FREQ:VOR ' num2str(VOR_freq)])
fprintf(ser,['DME:RANG ' num2str(Distance)])
%% clear Objects
clear obj

Thanks you for your answers


Log in to comment.

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.


Log in to comment.

Answer by elbaz samuel on 19 Sep 2013

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


Log in to comment.

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

MATLAB Academy

New to MATLAB?

Learn MATLAB today!