write(device,data,datatype)
writes the row or column vector data to the specified serial port
connection device. The function writes the data in the specified data
type datatype, regardless of the format in data.
The function suspends MATLAB® execution until the specified values are written.
Serial port connection, specified as a serialport
object.
Example: write(device,1:5,"uint8") writes to the serial port
connection device.
Numeric or ASCII data, specified as a row (1-by-N) or column
(N-by-1) vector of numeric values or as a character vector or
string scalar of text. For all numeric datatype types,
data is a row vector of values.
Example: write(device,[20:24],"int16") writes the values
[20,21,22,23,24].
Size and format of each value, specified as a character vector or string.
datatype determines the number of bytes to write for each value
and the interpretation of those bytes as a MATLAB data type. For ASCII text, you can specify datatype
as either "char" or "string".
Example: write(device,1:5,"int16") writes data as int16 data
type.
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window.
Web browsers do not support MATLAB commands.
Website auswählen
Wählen Sie eine Website aus, um übersetzte Inhalte (sofern verfügbar) sowie lokale Veranstaltungen und Angebote anzuzeigen. Auf der Grundlage Ihres Standorts empfehlen wir Ihnen die folgende Auswahl: .
Sie können auch eine Website aus der folgenden Liste auswählen:
So erhalten Sie die bestmögliche Leistung auf der Website
Wählen Sie für die bestmögliche Website-Leistung die Website für China (auf Chinesisch oder Englisch). Andere landesspezifische Websites von MathWorks sind für Besuche von Ihrem Standort aus nicht optimiert.