File Exchange

image thumbnail

MATLAB serial - code example

version (1.95 KB) by Steven Kolak
MATLAB with serial devices - code example


Updated 30 Oct 2018

View Version History

View License

Editor's Note: Popular File 2010 2011

MATLAB supports serial devices including RS-232 when using Instrument Control Toolbox.
This MATLAB code example shows you how to communicate with a serial device.

This MATLAB code example was automatically generated with a device configuration tool provided by the toolbox. Type "tmtool" to start this tool. This is a basic code example to show you how to get started using MATLAB to communicate with a serial device.

Learn more about using MATLAB with serial devices at:

Comments and Ratings (61)


Mahya Hatambeigi

I was able to connect my device to MATLAB using this code. But how to actually read and save the data which is sent from the device?

Supriya phalle

Cagri Akalin

Steve Grobler


yogan sganzerla

hello, quen I write pmode start or matlabpool('open',numberf of core) have one err. Do you know why:

Team 6


only basic information.....

chandu kapadnis

hekuran krasniqi

ooo lale e du mor burr ket program se e do profesori


Erdal Bizkevelci

M. A. Hopcroft

Don't waste your time- this is just the most basic four-line example copied straight from the MATLAB help file.


salim hadjsaid

Thank you,I was using:
s1.ReadAsyncMode = 'continuous';
but acquisition can't go down .05s

kee douang

Baba Omar


fathy alsaka

effendi dodi arisandi

thank you

din esh rajan


gilson borba

en gex

shahir uddin

it will help me to modify the project

renáta petrovková

Erick Suret


dragan djokovic

156 15616


Teerapun Phiyakunphanid

vab mishra

alex morais

its very good.

heri gunawan

ahmed abdalla

Juan García

Solicito su orientación para conseguir el serial de matlab 2006.

Dongwen zhang


Jose Medina


ALIN Kamdeu

it is good to have something to leaD US

patryk kubi?ski

jamal mazloom

tarik amrouche

Bouzegag younes

j'ai besoin d'un programme en matlab pour identifier une trame avec le protocole RS232
sur le oport série de mon pc;

shivi shetty

good application

Cheol Min Kim

Miguel Delgado

Nick Panagiotopoulos

Gowri shankar J

while using Rs-232 of PLC & SCADA the micro controller programming is used , while used in m- file programming , we r using the concept of c language

mahdi Haghzadeh

mahdi Haghzadeh

mahdi Haghzadeh

mahdi Haghzadeh

bontong wasri

Wang juan

Thangk You!

rashid addamt

thank u

jay collins

Manatchai Prommin


morin patrick

Maksic Natasa

sten ipkins

M. Huxby

Works for me. It is a basic example, but it shows how to use Matlab to talk to a serial device by using a tool, how the tool auto generates Matlab script for you, and how to generate a report.


Doesn't help me any! :(

Dave Billingham

MATLAB Release Compatibility
Created with R2006b
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

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

Start Hunting!