Hi everyone,
I’m a research assistant, and I’m fairly new to coding, so I apologize if this question has a more straightforward answer that I am not understanding.
The problem is primarily one of inconsistency. I have a code that works, but it only works 80-90% of the time; there is no difference in the computer, the inputs I give it, or the monitor that it is attached to, it can work one moment and the next give me the error. Typically, closing and re-opening Matlab resolves the issue, but on one occasion I have found it nessacary to restart the computer itself.
Here is the error I am getting:
Error using KbQueueCreate Keyboard queue for device NaN already in use by GetChar() et al. Use of GetChar/CharAvail/FlushEvents and keyboard queues is mutually exclusive!
Error in MIST_True_Beta>MIST_MAST_runs (line 755) KbQueueCreate();
Error in MIST_True_Beta (line 164) MIST_MAST_runs(sn,run,calib,dataFile);
What is odd about this to me, at least, is that if the error is to be taken as always true, the program should never run, yet it does most of the time! I understand I am using incompatible methods, however I am working on editing a 1700 line script, and resolving every instance to be the same is an incredibly duanting task. Furthermore, I tried to comment out instances of"GetChar/CharAvail/FlushEvents " and I still got the same error. I can provide specific code segments if that would be helpful, however it seems like the error is more general about using incompatible methods.
I am using a windows computer, a X1 Carbon ThinkPad, and I am coding in MatLab R2023b. Please let me know what other information would be helpful to include.
Thanks in advance!