title: Problems setting baud rate in Matlab
body: <p>I am trying to increase the baud rate for serial communication to a microcontroller using Matlab and it seems Matlab does not want to cooperate. My very basic setup in Matlab is:</p>
  
  <pre><code>s = serial('/dev/tty.usbserial-A104VT0Q')
  set(s,'BaudRate',256000)
  fopen(s)
  </code></pre>
  
  <p>I get this error:</p>
  
  <pre><code>Open failed: BaudRate could not be set to the specified value.
  </code></pre>
  
  <p>This works fine (no error) if the baud rate is 115200 or a lower standard baud rate, but I get this error for higher standard baud rates of 128000 or 256000 (<a href="https://www.mathworks.com/help/matlab/matlab_external/baudrate.html" rel="nofollow">Matlab lists standard rates here</a>) or for non-standard rates.  Why is this happening and how can I set the baud rate higher?</p>
  
  <p>If I set the baud rate from the microcontroller to 250000 and use the Arduino serial monitor at the same rate, it seems to work fine (can get successful serial communication of bytes), so I don't see that there is a hardware issue preventing this rate from being set.  So I suspect this is some quirk of Matlab, but my searching online hasn't found a solution.</p>
  
  <p>More about my setup:  using an Atmel ATUC3C1512C MCU on a custom board, the USART is going through an FTDI FT232RL (rated for up to 3 Mbaud) to USB, into a Macbook Pro running OS X 10.11.6, running Matlab R2016a.</p>
  
  <p>Again, the whole setup works at a baud rate of 115200, but I would like to increase the rate for the transmission of lots of data after a test is run and I can't figure out what's preventing me from setting it higher.  Thanks.</p>