<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Read data from nRF51 to MATLAB</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/13047/read-data-from-nrf51-to-matlab</link><description>Hi all, i&amp;#39;m continuing the exploration of the possibilities offered by BLE. I tried the example ble_app_uart on my nRF51 DK, sending for example the number &amp;quot;1&amp;quot; from my phone to the DK (in future i will send sensor data), which is connected via USB to</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 16 Nov 2017 10:42:33 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/13047/read-data-from-nrf51-to-matlab" /><item><title>RE: Read data from nRF51 to MATLAB</title><link>https://devzone.nordicsemi.com/thread/49740?ContentTypeID=1</link><pubDate>Thu, 16 Nov 2017 10:42:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:81ce04fd-d1a3-42ae-a09c-c3014dc3f404</guid><dc:creator>BCI</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;I think you can help me. I can&amp;#39;t manage to read data from nRF51 DK to Matlab using an nRF51 dongle. In my case, I have stored data in PCA10028, I can open the serial port corresponding to the nRF51 dongle in Matlab. I can also visualize packets on nRF Connect.&lt;/p&gt;
&lt;p&gt;Do I need special functions for reading and writing data in Matlab? Now, I am coding :
obj = serial(&amp;#39;COM12&amp;#39;);
fopen(obj);
a=get(obj);
record(obj,&amp;#39;on&amp;#39;);
UUID = ['2A','00'];
dec=hex2dec(UUID);
fwrite(obj,char(dec)&amp;#39;);
[R,count] = fread(obj);&lt;/p&gt;
&lt;p&gt;and always have in return :
Warning: Unsuccessful read: The specified amount of data was not returned within the Timeout
period..&lt;/p&gt;
&lt;p&gt;ans =&lt;/p&gt;
&lt;p&gt;1×0 empty double row vector&lt;/p&gt;
&lt;p&gt;Thank you in advance,&lt;/p&gt;
&lt;p&gt;BCI&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Read data from nRF51 to MATLAB</title><link>https://devzone.nordicsemi.com/thread/49739?ContentTypeID=1</link><pubDate>Thu, 07 Apr 2016 17:44:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:821bbf0c-7205-46cd-91f1-9fe36dfaeaae</guid><dc:creator>Revo</dc:creator><description>&lt;p&gt;Perfect thank you, and so how can i receive in Matlab directly the decimal (or float for future application) value? Shall i do some conversion to the data received by the DK board before sending it to the COM port or convert it later on Matlab?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Read data from nRF51 to MATLAB</title><link>https://devzone.nordicsemi.com/thread/49738?ContentTypeID=1</link><pubDate>Thu, 07 Apr 2016 15:12:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:58a6547f-4f24-4847-858d-f4a049ae19b0</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;53 10 in hex is 0x45 0x0a. 0x45 is the digit &amp;#39;5&amp;#39; in ASCII and 0x0a linefeed, or an end of line. 54 is 0x46, or the digit &amp;#39;6&amp;#39; and I think you can work out the rest.&lt;/p&gt;
&lt;p&gt;You&amp;#39;re receiving ASCII strings, with linefeeds at the end of each character.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>