LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

pca code from matlab to labview

Dear sir,

 i have written a code using principal component analysis for sensor failure detection in matlab. my code runs good in matlab and I'm getting proper outputs. But the controller in which I'm going to use the code will support only c , c++  , .net  or labview code and it'll not support matlab. So I'm planning convert my matlab code into a equivalent labview code, is it possible? is so kindly guide me how to proceed.

0 Kudos
Message 1 of 3
(3,407 Views)

Hi number,

 

yes it's possible: use a MathScript Node!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 3
(3,406 Views)

It really depends on the complexity of your Matlab code. While the MathScript node is a possibility, MathScript is not a 100% replacement for Matlab. The two are different languages. Some Matlab functions don't even exist in MathScript, and certainly if you're using toolkits, you won't have them in MathScript.

 

As for converting the Matlab code into pure LabVIEW, that may be possible, but again, it really depends on the complexity, as well as your level of expertise in both languages. Plus, the way some functions are implemented in Matlab will be different than in LabVIEW (e.g., FFT functions). Thus, it's impossible for anybody to say how practical it would be for you to do it. As to how to proceed, all that I can suggest is to take inventory of exactly what you are doing in the Matlab code and break it down into basic principles. Then, see how the same sort of thing would be done in LabVIEW.

 

While we can offer tips on some parts, there's clearly no way we can tell you how to convert the whole program. That's just something you're going to have to do yourself.

0 Kudos
Message 3 of 3
(3,396 Views)