LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Same code gives different results in Matlab Script in Labview and Matlab

Hello!

Thank you very mch for the replies, I did not have time till now to check it. You were right with the TS_Ant being initialized to 150, I am not sure why it was like that, but thanks, I have chaned it, although it did not solve my problem.

So, actually the matlab code is the same, although written in an .m file:


Torso_Angle=-RawData(4)*pi/180;
Torso_AngleVel=(Torso_Angle-Tangle_Ant)/T;
Torso_AngleVel=(T*Torso_AngleVel+0.02*Tangle_Ant)/(0.02+T);

TS=[Torso_Angle;Torso_AngleVel]';

 

The results of Labview compared to those of Matlab for the same period of time I plotted in a post before.

I think the problem is that somehow, I am not sure how, the RawData I am talking about is uploaded undersampled. Because I checked the file and actually it has the same precision as in Matlab...but when uploaded and plotted is different.

I am sorry I cannot upload the file, I cannot cut it for now. I will see if tomorrow I can do something.

I know I am not very precise, but this is a part of a quite huge program and is difficult to cut it around...

Thanks again for your help

0 Kudos
Message 21 of 22
(269 Views)

SOLVED!!!
Hello everyone!

First, thank you very much for ur replies. Second, I am gonna kill myself. Stupid mistake: I had my file with dots instead of commas, so everything was uploaded like integers and so the derivatives were not smooth.Smiley Embarassed

I note it hard-copy in my brain as the first thing to check next time I have a problem.

Have a nice day!

 

0 Kudos
Message 22 of 22
(251 Views)