LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

MATLAB fit doesn't work in LabView

Hi everyone,

 

I have a MATLAB program that should fit an error function (4 fit parameter). Because it is not the easiest function I have to give some start parameter. I tried to estimate them from my data and it worked perfectly fine while doing it in MATLAB but if I use the same code in LabView the fit doesn't work anymore (even if the data is exactly the same). 

Have you an idea why this is the case? 

 

Because my code is pretty complicated I didn't attached the VI here. Hopefully you can me help anyway

 

Thank you for your help!

0 Kudos
Message 1 of 4
(1,120 Views)

@Annika111 wrote:

Hi everyone,

Hi! and welcome to the forum!

 

...

Because my code is pretty complicated I didn't attached the VI here. Hopefully you can me help anyway

The chances are pretty much zero without seeing what you are trying to do. Even just posting the MATLAB code will drastically increase your chances of a solution being found. Can you provide a minimal, reproducible example (https://stackoverflow.com/help/minimal-reproducible-example)?

 

I'd give it a decent chance that creating such an example may clear up the problem itself. A linear fit VI need not be complicated at all.

0 Kudos
Message 2 of 4
(1,113 Views)

Also chances are that using the nonlinear fit of LabVIEW would simplify things dramatically. What is the function? Do you have some typical data?

 

(For example, here's an old example to fit a 3 parameter error function. Read the entire thread.)

0 Kudos
Message 3 of 4
(1,091 Views)

@Annika111 wrote:

it worked perfectly fine while doing it in MATLAB but if I use the same code in LabView the fit doesn't work anymore (even if the data is exactly the same). 


You need to explain exactly what you are doing in LabVIEW and what "same code" means. Your description is way too ambiguous.

 

  • Did you implement your code in pure LabVIEW (no text based code!)?
  • Are you using your MATLAB code in a MathScript node?
  • Are you using your MATLAB code is a Matlab script node?

 

What is the meaning of "does not work"?

 

  • No result?
  • Wrong result?
  • Slightly different result?
  • Error message?
  • etc.

 

You really need to attach your code AND some typical data, no matter how big it is. 😄

Message 4 of 4
(1,082 Views)