Filter löschen
Filter löschen

sending data from matlab to 8051

1 Ansicht (letzte 30 Tage)
anas qazaz
anas qazaz am 24 Mär. 2013
hi,all i have file.bin when i opened it in matlab will show matrix with values such that -30 -11.2 5 10 etc how i can send these data via serial port?is fwrite instruction useful?how plzzzzzzzzzz help with code

Akzeptierte Antwort

Walter Roberson
Walter Roberson am 24 Mär. 2013
bufsiz = 1024; %adjust at will
infid = fopen('file.bin');
while true
buffer = fread(infid, bufsiz, '*uint8');
if isempty(buffer); break; end
fwrite(s, buffer, 'uint8');
end
fclose(fid);

Weitere Antworten (0)

Kategorien

Mehr zu Low-Level File I/O finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by