continue data collection from serial Matlab
2 次查看(过去 30 天)
显示 更早的评论
Hi everyone,
I have a device connected to my laptop by USB (COM3). The device sends data with a sample time of 2 Hz, so every 0.5s
this is what i have so far:
clear all
close all
clc
fclose('all'); % close all open files
delete(instrfindall); % Reset Com Port
delete(timerfindall); % Delete Timers
%% Create a serial object
board = serial('COM3', 'BaudRate', 38400, 'DataBits',8);
fopen(board);
record(board,'on');
fscanf(board)
----> and this is the result:
"09:18",1483.91,-2.07,-1.79,67.7,1.412,-0.61,-0.29,88.5,0.939,"" (this is what the device sends every 0.5s)
But what I want is to continuesly get the data from the device so i can real-time plot each value in a graph for instance.
could someone help me out for i am stuck for al while
Many thanks!!
greets
Paul
0 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Data Import and Analysis 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!