02-24-2006 02:16 PM
02-24-2006 05:47 PM
Hi
I encountered this problem before. I used labview 5.1 and matlab 6.1
The only way I found to resolve this issue was to use the "clear all" command in Matlab at the beginning of the script. The problem with this solution was (And my memory is a bit hazy, because this was 4 years ago in a different company and a different country) that it somehow affected the variables being transfered from labview to matlab and vice versa.
So, I realized that the best way was to save the variables to files (I used the Matlab script for that) and communicate between labview and matlab with writes/reads to these files:
It went something like this (This is just an example for saving x, y and z in a specific format)
save('c:\matlab6p1\work\1','x','-ascii','-double','-tabs');
save('c:\matlab6p1\work\2','y','-ascii','-double','-tabs');
save('c:\matlab6p1\work\3','z','-ascii','-double','-tabs');
I also had a lot of trouble with the Matlab not finding the m files I altered during run time although I specifically added their paths, so I also had to use the next (In the script):
addpath(genpath('c:\Matlab-files\'))
eventually everything worked perfectly.
I'm sorry I can't bring you the exact code and be more detailed. I don't have all my notes from that time.
Ami
02-24-2006 07:57 PM
04-20-2006 05:44 AM
04-20-2006 09:57 AM