matlab simulink
Answer
12/6/18 10:20 AM

Hi to Community,

 

i wanna use MATLAB to simulink live (real-time) data, which transfer from XDK over USB or WiFi, but i didn't simulink real-time before.

Do you have any suggestion that help me to do that ?

 

Best regards

Sepehr

0 (0 Votes)
RE: matlab simulink
Answer
12/6/18 3:45 PM as a reply to Sepehr Habibollahzadeh.
Hello Sepehr,

did you tested the options, I recommended in your last thread regarding the same question bluetooth-pc connection ?

Additionally, there are two other threads regarding Matlab and the XDK available, I recommend taking a look at them too:

Recieve udp data and Serial communication to Matlab (UART or USB)) .

Please let me know if this was helpful and feel free to ask if you have further questions.

Kind regards,
Franjo
+1 (1 Vote)
RE: matlab simulink
Answer
12/11/18 12:54 PM as a reply to Franjo Stjepandic.

Hi Franjo,

 

i read those links, which you give me. i undrestand that for simulinking data, first of all i should use Python-software to set up a server for receiving data from XDK to my PC over WiFi. Second step is that, now i should change this data to .CSV file and then use CSV file in SIMULINK.

 

now my questions, 1. can i use this way too have live simulation?

 2. is that necessary to set up a server with python, or can i simply use Hotspot or Router and recieve data directly in MATLAB? 

 

 

Best regards

Sepehr

0 (0 Votes)
RE: matlab simulink
Answer
12/12/18 4:37 PM as a reply to Sepehr Habibollahzadeh.
Hello Sepehr,

This setup would also work for a live simulation. However, I found an easier approach to solve this.
You can use the integrated Matlab functionality for UDP or USB to get the data from the XDK for a real-time simulation.

For UDP, you can follow the example here , while you only need to change to the port you want to use and insert 127.0.0.1 as remote host. Additionally to this, I recommend taking a look at this thread here , where a similar question was answered.

As alternative to UDP, you could also use USB. In this video here it is explained how to setup the connection on the Matlab side.
For the XDK side, you would to need to implement the USB sending functionality included with the XDK sensors manually. For that, I recommend taking a the corresponding USB and sensors articles in the XDK knowledgebase .

Please tell me if this was helpful, and do not hesitate to ask further questions.

Kind regards,
Franjo
0 (0 Votes)
RE: matlab simulink
Answer
12/17/18 12:26 AM as a reply to Franjo Stjepandic.

Hello Franjo,

thanks for your support.

the video, which you mentioned , is NOT my problem. i actually know how to see live data or streaming data over COM in MATLAB.  i want to plot this live data and for this purpose , the data must be numerical or actually we don't have numerical value over COM.

so, maybe we can simulate that data but first of all should change this string data and that's my question?! 

(in addition, i'm really wondering that nobody did not plot data before!)

 

Best regards

Sepehr

 

0 (0 Votes)