LabVIEW MathScript RT Module

cancel
Showing results for 
Search instead for 
Did you mean: 

Execution speed MathScript vs Matlab Script in LV

Hello.

I have a question about the execution speed of MathScript vs MatlabScript in LV. Becasue of the particular application I am building I have to use to two for loops in the script. For the attached simple examples,  it takes MatlabScript 1-2 seconds to compute the results but it takes MathScript about 9-10 seconds to do so. I just wonder if there is a way to get around this. If I have to use MatlabScript in the the LV program, how do I build a standalone application using Application Builder? Thanks a lot for the help.

Message Edited by wongnathan on 02-21-2010 12:42 PM
Message Edited by wongnathan on 02-21-2010 12:42 PM
Download All
0 Kudos
Message 1 of 2
(7,414 Views)

Hello,

 

One way to improve the performance of the MathScript code is to preallocate the array before the loop. In your example, the array is being resized on every iteration, which slows performance considerably. When I added the following line to the top of the script, it executed 50 times faster for me:

 

 

z = zeros(300);

 

Also, the runtime performance of MathScript has improved through different versions of LabVIEW and we have plans to continue to improve it. Are you using LabVIEW 2009 SP1?

 

Regarding the MATLAB script node, the only restriction that I'm aware of when using in a built application is that The MathWorks, Inc. MATLAB® software must be installed on any machine to which you deploy your application. Are you seeing other issues with it?

 

MATLAB® is a registered trademark of The MathWorks, Inc.

 

jattas

LabVIEW MathScript R&D

 

 

 

 

Message 2 of 2
(7,396 Views)