I am trying to plot data from arduino to matlab using serial port.

Now I first upload the code to arduino and then start matlab and I am able to plot the graph there.

After plotting I close the matlab plot (however the matlab software remains open).

Then if I try to reprogram the arduino, I ger the following message

Quote

Serial port 'COM 6' already in use. Try quitting any other programs that might be using it.

So then I close matlab, and then restart arduino, and then upload the code and it works.

But this is very inconvenient because restarting matlab again and again takes a lot of time.

Does anyone know a work around? Help will be greatly appreciated.

Thanks and regards