title: No ports are available error while trying to read data from COM port in Matlab
body: <p>I am trying to read data from the serial port of my laptop. The data is coming from the MSP430 through COM13.</p>
  
  <p>When I try to access the data through MATLAB, it says -</p>
  
  <p>??? Error using ==> serial.fopen at 72
  Port: COM13 is not available. No ports are available.
  Use INSTRFIND to determine if other instrument objects are connected to the requested device.</p>
  
  <p>Error in ==> interfaceplot at 3
  fopen(s)</p>
  
  <p>The code I am using is this-</p>
  
  <pre><code>s = serial('COM13'); %assigns the object s to serial port
  
  set(s, 'InputBufferSize', 128); %number of bytes in inout buffer
  set(s, 'FlowControl', 'none');
  set(s, 'BaudRate', 9600);
  set(s, 'Parity', 'none');
  set(s, 'DataBits', 8);
  set(s, 'StopBit', 1);
  set(s, 'Timeout',100);
  %clc;
  
  disp(get(s,'Name'));
  prop(1)=(get(s,'BaudRate'));
  prop(2)=(get(s,'DataBits'));
  prop(3)=(get(s, 'StopBit'));
  prop(4)=(get(s, 'InputBufferSize'));
  
  disp([num2str(prop)]);
  
  fopen(s);           %opens the serial port
  
  data = fscanf(s);
  
  fclose(s); %close the serial port
  </code></pre>