From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

implementing linear fit vi in matlab

Solved!
Go to solution

Hello all,

 

I need to implement the "Linear Fit.vi" in MATLAB. I am using the Least Squares method in this .vi but unfortunately MATLAB operator "\" does not give me the same result. This is strange since they both claim to use exactly the same methods of calculation. 

Here is the MATLAB link for this operation.

 

http://www.mathworks.com/help/toolbox/curvefit/bq_5ka6-1.html

 

I appreciate your help on this case.

Thanks.

 

Amir
0 Kudos
Message 1 of 3
(2,095 Views)

This is the LabVIEW forum.

 

Is this a matlab question or a LabVIEW question? If you have matlab problems, I suggest you ask elsewhere. I am sure there is a dedicated forum.

 

If you want to implement the same algorithm in LabVIEW, please say so. 😉

0 Kudos
Message 2 of 3
(2,094 Views)
Solution
Accepted by topic author ballbouncing

Re-reading your post, you are leaving out way to much information for us to make sense of it all.

 

Since you are apparently comparing LabVIEW linear fit and matlab linear fit, I assume you have fully functioning code for both.

 

Can you attach your VI and the important section of your matlab code?

 

Where does the "\" operator fit into all this?

 

In what way are the results different. Are they at least similar? If you do a fit with paper and pencil using very few points, does it agree with LabVIEW, matlab, or neither?

 

0 Kudos
Message 3 of 3
(2,085 Views)