Calendar Latest Topics
 
 
 


Reply
  Author   Comment  
Edward

Administrator
Registered:
Posts: 260
Reply with quote  #1 
This took me a while to find, so I wanted to share it with other ML users.

If you're directory preferences are not set properly ML will not even run trials.

The option to set them is under File->Directory Preferences, but it's easy to overlook because there are already so many other variables. You can also call set_ml_preferences.m in matlab directly.

These directory preferences are independent of all your other system settings which are loaded/saved in the Task properties area of the main window!
0
coxma

Junior Member
Registered:
Posts: 7
Reply with quote  #2 
We also had a lot of issues with this in our lab, and we found the solution that worked for us was to write a function "startMonkeyLogic" that we placed one level above our MonkeyLogic directories. In our case, we had two versions of MonkeyLogic running on the same machine (this was during the no-java to java switch). 

The function is attached (as .txt, but we use it as .m) and hopefully provides an example of how to use set_ml_preferences.m 

FYI, if you look at the function in detail, "startMonkeyLogic" does a few other startup related operations. These include adding a "UTILS" folder to the search path (we store some custom files here), checking that MATLAB was launched "as administrator", and deletes everything in the existing "runtime" folder (safety from when we were constantly changing our timing scripts and gen functions).  


 
Attached Files
txt startMonkeyLogic.txt (2.89 KB, 15 views)

0
Jaewon

Administrator
Registered:
Posts: 971
Reply with quote  #3 
MonkeyLogic (ML) keeps some information between MATLAB sessions by storing it in MATLAB's "preference" (see the MATLAB help for setpref, getpref or rmpref), which is fine. However, it can cause some problems when there are multiple copies of ML in one computer, because 1) ML does not update this "preference" if there is a value already stored by previous copies and 2) ML determines the location of the runtime folder based on the location of "monkeylogic.m" that is currently in use when it writes runtime files, but it tries to read runtimes from the folder location stored in the "preference". Therefore, if the first ML copy has its runtime folder location stored in the preference and you run the second copy without changing it, you will not see any change you made for your tasks or will get an error, because the second copy will read whatever in the runtime folder of the first copy.

The attached is a MATLAB script that I made for my colleagues to switch between multiple ML copies. I guess it does similar things that coxma's script does, but my script makes minimal changes that are absolutely necessary. All you need to do is to modify the first two lines and run the script before ML. You can add it as a command line option when you start MATLAB, like

"... matlab.exe" -r "setMLpath"

or, if you use the nojvm option,

"... matlab.exe" -nojvm -r "setMLpath"

 
Attached Files
txt setMLpath.m.txt (725 Bytes, 8 views)

0
Edward

Administrator
Registered:
Posts: 260
Reply with quote  #4 
Thanks. Also there are two scripts that come with ML : set_ml_preferences, and set_ml_directories. The first is what is called when the user chooses the menu option File->Directory preferences. If the directories are not set correctly, strange things can happen. 
0
Previous Topic | Next Topic
Print
Reply

Quick Navigation:

Easily create a Forum Website with Website Toolbox.