I am trying to connect a digital sensor to a computer through MATLAB.
First, I send a request for data to the sensor, then the sensor responds with a six-byte stream.
MATLAB reads the sensor as follows:
data1 = fscanf(obj1, '%c', 6);
I know exactly what the contents of the data should be, but I do not know how to read the data in the package that MATLAB released.
A packet ( data1) is only 6 bytes, but how can I access each individual element as a whole?
I never touched MATLAB programming before I lost.
Side question: what do the data formats the MATLAB %c, %s, %c\nand %s\n? I tried to find it, but found nothing.
Faken source
share