How can I open and read data from a serial port?
1 view (last 30 days)
Show older comments
To open/read pre-recorded data I have previously used:
fileID = fopen('filename.txt', 'rt'); line = fgetl(fileID);
to read the text file line by line. However, I need to be able to read data from an instrument connected to a serial port.
i have used
fid = serial(COMx,baudrate,9600);
fopen(fid);
Will this work for a live instrument?
0 Comments
Answers (1)
Walter Roberson
on 24 May 2016
fid = serial('COMx', 'baudrate', 9600);
1 Comment
islam dib
on 9 Dec 2020
hello,
See Also
Categories
Find more on Standard File Formats in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!