07-03-2009 03:25 AM
I'm using Labview 8.6 combined with Matlab between Matlab Script Node and I have some problems. Im using Matlab R2008a. In Matlab i’m using the ident toolbox to identify some processes given a data text archive.
I have a function that depends on another functions that doesn't works fine when it’s called from Matlab Script Node.
I have test the function on Matlab and it shows me the proper results. But when I put it on Labview with Matlab script Node (I’ve also probed to put it on Mathscript node and it doesn’t work either) doesn’t give me the correct values (the same values that I have obtained when I’ve call the function from Matlab).
I think that the problem is in my code, so that I will give you all the functions I’ve used for accomplish my purposes and the used VI.
(I’ve only revised* the functions made by me, and not the rest of them, I suppose that they don’t have characteristics that Matlab don’t give support to )
*that there aren’t any characteristics of Matlab language that Matlab Script Node don’t support. (I read on NI forums that Labview (actually Matlab Script Node) doesn’t use Matlab structures correctly when you put them in the form “variable.field” (using the “.” Operator) and because of this fact, i have modified the syntaxis of all the structures that i put before; moreover: i’ve read that it also doesn’t works fine with arrays of 3D or more ).
To resume, I will be so happy if anybody wants to read my code for searching any incompatibility between certain expressions and Matlab Script Node.
Archives made by me:
NOTE: change the path given
to the variables “pa” and “ruta_ar” (in “scriptaparte.vi”) “D:\Documents and
Main function prototype:
Charging certain values:
You only have to copy this on Matlab to view the results. However i put it the correct values of outputs for this inputs:
numreg =[309.4818 -305.4845]
denreg =[1.0000 1.5445] Tmuestreo=0.015 status=1
num_gs = 0 -0.3310 0.7064
den_gs = 1.0000 0.2858 0 delay=0.45
dend= 1.0000 -1.9957 0.9957
bestPer = 91.2001
My opinion: I think that the the program is not well interpreted by Matlab Script Node because when the VI prints all the outputs for all the models (output to the instruction compare(model1,...modeln), the correct (the model which has the best fit -percentage-) model has a different percentage of similarity to the data (in both cases i’m using the same .txt to load the data). Some output variables are right (ie. Tmuestreo).
I give you the folder where i’m working.
Sorry, but my english is not so good.
(If anybody speaks Spanish well, i accept to be replied on this language)
07-06-2009 03:46 PM
07-07-2009 04:23 PM
I was not able to execute your m files. It appears that I'm missing the file containing iddata's functional definition. Please attach that file and I will see if I can execute your files.