0
votes

I'm using Matlab 2013a and the fopen(serial) command takes a long time to execute. It used to run smoothly when I had installed it but now, it seems opening ports is getting slower. eg code:

port=serial('com1');

fopen(port);

the second command takes forever to execute. What might be the problem?

P.S: I tried re-installing Matlab but it did not work.

2
Have you been closing the port (serial/fclose) after you're done using it? Does the above code take "forever" on fresh restart of Matlab?horchler
Tried opening and closing the port repeatedly. fopen(port); still takes almost 20 seconds.Aditya Nair
Does the first time take 20 seconds? Is your actual goal to be able to repeatedly open and close the port? Opening a bluetooth serial port my computer (OS X 10.9.2, R2013b) normally takes about 0.01 seconds. But if I close it and immediately try to reopen it, it can take about 2.2 seconds. There's likely some asynchronous stuff going on and the hardware/driver itself likely does clean up after closing. Still, 20 seconds is a bit long. Do you have hardware plugged into this port?horchler
Problem solved. I switched off all my wireless networks and now it opens easily. I had a lot of unknown bluetooth devices in my device manager. Once bluetooth was switched off it worked like a charm. :)Aditya Nair
Thank you! I think you should post that as an answer. I had some other COMs in my device manager, I just disabled them and the time is reduced from 7-8 seconds to nothing.p8me

2 Answers

2
votes

Problem solved. I switched off all my wireless networks and now it opens easily. I had a lot of unknown bluetooth devices in my device manager.

FIX: Switching off blue tooth and/or disabling any COMs that are not being used from the device manager.

1
votes

I have same problem. In my case, switch off bluetooth device solved the problem.