I have .csv file on my desktop which get replaced. I want to use a command in matlab which imports this file every time it gets changed into matlab for calculations. I got this formula:
fsw = System.IO.FileSystemWatcher();fsw.Path = 'C:\Users\wolfx\Desktop';fsw.Filter = 'filename.csv';fsw.EnableRaisingEvents = true;listenerhandle = addlistener(fsw, 'Changed', importfcn);%signature of importfcn is function importfcn(sender, eventargs)
%add a small delay in importfcn before reading the file as the event is raised
%to make sure that file modification is complete
This formula gives me the error Undefined function or variable 'importfcn'.
Can anyone give me a hint or a site where I can read more about this?
thanks
Best Answer