LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

dot product gives me NaN but my arrays are same size and full

Solved!
Go to solution

Hi there,

 

i'm trying to get the dot product of a vector array of an SVD of differnt inputs (signals). But it only outputs NaN to me. The arrays are the same size and they are not empty but it still reads it. Can anyone help? 🙂 

 

Kelly

0 Kudos
Message 1 of 11
(3,875 Views)

Hi kelob,

 

you mean you got problems doing this: check.png ???

 

This fails when the arrays don't have the same size or when they contain "bad" data (like NaN).

 

Can you cross-check your VI? Or attach a LV2011 version of it?

Best regards,
GerdW


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

Hi GerdW,

 

Many thanks for the reply! That's it yeah I know its staring me in the face but can't figure it out. Would it be my RT data causing problems you think? I've attached 2011 versions of vis 🙂

 

kelly

Download All
0 Kudos
Message 3 of 11
(3,859 Views)

Hi kelob,

 

to judge the possible problem you need to attach a VI with some real data embedded!

 

Run your VI until it shows some typical data in your indicators. Then stop it, select all controls/indicators, choose "set selected values as default" from edit menu (may sound similar, don't have an English LV version in use) and save your VI. Then re-attach it…

Best regards,
GerdW


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

Hi GerdW,

 

I followed your instructions and attached. 🙂 

 

Many thanks for your help!

0 Kudos
Message 5 of 11
(3,845 Views)

Hi kelob,

 

now I can see some values in "SVD of covariance", but I don't know the values coming from "training set".

Please create an indicator for those data too and re-attach your VI…

Best regards,
GerdW


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

Hi GerdW,


Apologies I forgot to attach that vi as well the last time. I have attached it here. Though it is only 3 simulated signals I have set up myself to work with as an exmaple for the time being as I have not recorded data yet. I am hoping I can find the dot product between my real time data array and each one of my arrays in the Footstep_trainingSet so I can decide whether the real time data can be classified as 'no event', 'tap' or 'bang' 🙂

 

Kelly

0 Kudos
Message 7 of 11
(3,834 Views)

Hi kelob,

 

your data give a valid result for the dot product:

check.png

What else do you expect?

 

Are you really expecting a good signal from reading an AI using the ScanEngine without any timing information whatsoever?

Best regards,
GerdW


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

Cheers gerdW,

 

I was looking for a reading of some kind all right but wasn't sure what i was looking for as there is no real help online for LabVIEW and is much different to text based.


Many thanks for your time it is greatly appreciated,

 

I shall restart it and hopefully won't read at NaN 🙂

 

Regards,

Kelly

0 Kudos
Message 9 of 11
(3,812 Views)
Solution
Accepted by kelOb

You'll need to expand the number of decimal points you're displaying in your result- those components of the dot product are on the order of 10^-13.

Message 10 of 11
(3,804 Views)