필터 지우기
필터 지우기

sending data from matlab to 8051

조회 수: 1 (최근 30일)
anas qazaz
anas qazaz 2013년 3월 24일
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

채택된 답변

Walter Roberson
Walter Roberson 2013년 3월 24일
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);

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Low-Level File I/O에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by