12-14-2010 03:21 PM
Hi, I am an beginner user of LabView's MathScript Module,
I have the following problem when integrating my MATLAB code into LabView, for HMM: In my program, I tried to call a user defined MATLAB function called 'mixgaussinit.m' It show this error ..
"
Possible reason(s):
LabVIEW: A recognition error occurred while generating a stream of tokens.
"
the line 36 of the file is this "mu = reshape(mix.centres', [d M])"
mix.centers is a structure..
How can this error be corrected?
Solved! Go to Solution.
12-14-2010 03:52 PM
Hi interstellar,
Currently MathScript does not support the use of structures or cell arrays. One workaround would be to use a separate variable for each element of a cell array or structure (e.g. instead of mix.centres use mix_centres). Would it be possible for you to share more of your m code? Any use of structures and cell arrays will greatly help us define and scope the important use cases to support in MathScript.
Regards,
K Scott
12-15-2010
12:42 AM
- last edited on
12-17-2010
08:07 AM
by
Support
Hi Scott.. Thank you for replying.. Actually the variable are passed from a different function in form of a structure.. So converting the variable for example to mix_centers would be difficult because there are too many variable... Isnt there any other way to do the same?
I'm attaching the m file(its in txt format because .m is not supported).. error in line 36 column 20..
Thank you
Regards
12-15-2010 02:15 PM
Without knowing anymore about the gmm and gmminit functions defined in your script I am unable to recommend a solution. Based on what I can see, I recommend that you modify those functions to return the variables required in this script (e.g. mix.centres, mix.covars, etc...) Other than that I can only say that structures support is something we hope to offer in a future release of MathScript.
Regards,
K Scott
12-16-2010
01:40 PM
- last edited on
12-17-2010
08:07 AM
by
Support
Well, then if i mail you the above mentioned function will you be able to find any other solution?
thanks for your reply..
Regards.
12-16-2010 05:12 PM
I just noticed that these files appear to be under copyright. My first question is do you have the copyright permissions to post them in a public forum? If not then you may wish to delete them. That being said I have examined the code and it seems easy enough to work around your issues (provided you have the copyright permissions). The way to work around the issues is indeed to replace the struct fields with variables. This will of course require you to change a couple function definitions to input and output the neccesary variables which I believe was at most 5 variables. You will also need to redo the error checking code that uses a cell array. Altogether I estimate about 30 minutes of work. I would have given you the work around in these files had the files not been copyrighted. So, unfortunately, you will have to implement the work around yourself.
Good luck!
K Scott