continue data collection from serial Matlab

1 次查看(过去 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 个)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by