LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to draw line of best fit?

Hey all,

 

I am trying to draw a line of best fit with the scattered points being displayed as well. I have attached my VI below and tried all sorts of methods,

but to no avail. I am aware that there is a 'liner fit.vi' which I tried, but it did not give me what I wanted. In fact the line wasn't best fit at all.

I hope someone could help me as I'm new to LabVIEW.

 

Thanks in advance!

 

Cheers,
Ruben 

0 Kudos
Message 1 of 28
(3,911 Views)

Hi Ruben

 

The Linear Fit.vi should provide the results you require.  Check the attachment for an edited version of your code.  Does this solve your problem?  You can check the help file for advice on using different fitting techniques, setting tolerances and weightings.


Regards,

Peter D

0 Kudos
Message 2 of 28
(3,906 Views)

Here is the file for LabVIEW 8.6.


Regards,

Peter D

Message 3 of 28
(3,902 Views)

Here is what I would do.

 

Tim
GHSP
Message 4 of 28
(3,900 Views)

And here is a version for 8.0

Tim
GHSP
0 Kudos
Message 5 of 28
(3,897 Views)

And to take it to the next level

Tim
GHSP
0 Kudos
Message 6 of 28
(3,892 Views)

Thanks Peter, it seems to work the way I want it to. I am designing this for an engine component

and may run into further problems as I go along. But thanks so much for this! Appreciate it!

 

Ruben

0 Kudos
Message 7 of 28
(3,885 Views)

Hi Tim,

 

I seem to be unable to open your programme on LabVIEW 8.6. It appears like you have saved it in version 9.0

Could you try saving it in a lower version and post it again?

 

Thanks so much

 

Ruben

0 Kudos
Message 8 of 28
(3,883 Views)

Did you look at my code? it is much clearner and easier to maintain.

Tim
GHSP
0 Kudos
Message 9 of 28
(3,882 Views)

This should be 8.0 version

Tim
GHSP
0 Kudos
Message 10 of 28
(3,881 Views)