How to read serial data correctly through Matlab

前端 未结 2 1958
予麋鹿
予麋鹿 2021-01-13 13:49

I am using Matlab to read data from a serial port coming through a microprocessor. The data is in hexadecimal format with each sample of 4 bytes(32 bits). When I read this d

2条回答
  •  礼貌的吻别
    2021-01-13 14:44

    serialOne=serial('COM1', 'BaudRate', 9600);
    
    fopen(serialOne);
    
    fprintf(serialOne,'textFile.txt'); <<<---this is for write  (for read, use fscanf)
    
    fclose(serialOne);
    

提交回复
热议问题