MATLAB: I am supposed to get ecg signal from the ecg text data however the code should be written following the protocol i am new in matlab so a little help please..

ecg signal processingMATLAB

1. read the start bytes: 0x5A and 0xA5
2. As soon you detect this, read the all 17 bytes
3. Double check of these best just only have 0x5A, 0xA5 once. If there
is more you will need to discard the first 0x5A, 0xA5 as your starting
point and go back to step 1. If only once detected go to next step.
4. Read byte 5th and 6th for Ch1. Combine this two bytes: 5th byte for
the high byte and 6th byte for the low byte and convert it to decimal.
5. start the plot figure value versus time. X axes for the time; Y axes
for the value of that byte.
6. Repeat this until the whole data finish.
the data is
E0 06 14 02 7A 02 62 7A FE A5 5A 02 02 02 17 00
24 00 9D 00 21 00 0F 00 0C 0F A5 5A 02 03 01 F6
00 07 00 9C 00 21 00 0F 00 0C 0F A5 5A 02 04 01
E7 03 E9 00 9D 00 21 00 0F 00 0C 0F A5 5A 02 05
02 0C 03 FF 00 9D 00 21 00 0F 00 0C 0F A5 5A 02
06 02 22 01 9B 00 9D 00 21 00 0F 00 0C 0F A5 5A
02 07 02 19 00 2D 00 9D 00 21 00 0F 00 0C 0F A5
5A 02 08 01 F9 00 05 00 9D 00 21 00 0F 00 0C 0F
A5 5A 02 09 01 E6 03 97 00 9D 00 21 00 0F 00 0C
0F A5 5A 02 0A 02 06 03 FF 00 9D 00 21 00 0F 00
0C 0F A5 5A 02 0B 02 21 02 38 00 9D 00 21 00 0F
00 0C 0F A5 5A 02 0C 02 1D 00 3E 00 9D 00 21 00
0F 00 0C 0F A5 5A 02 0D 01 FF 00 07 00 9D 00 21
00 0F 00 0C 0F A5 5A 02 0E 01 E6 03 4B 00 9D 00
21 00 0F 00 0C 0F A5 5A 02 0F 02 00 03 FF 00 9D
00 21 00 0F 00 0C 0F A5 5A 02 10 02 1F 02 FC 00
9D 00 22 00 0F 00 0C 0F A5 5A 02 11 02 1F 00 53
00 9D 00 21 00 0F 00 0C 0F A5 5A 02 12 02 04 00
09 00 9D 00 21 00 0F 00 0C 0F A5 5A 02 13 01 E5
02 CB 00 9D 00 22 00 0F 00 0C 0F A5 5A 02 14 01
FA 03 FF 00 9D 00 22 00 0F 00 0C 0F A5 5A 02 15
02 1C 03 BC 00 9D 00 22 00 0F 00 0C 0F A5 5A 02
16 02 20 00 68 00 9D 00 21 00 0F 00 0C 0F A5 5A
02 17 02 09 00 0C 00 9D 00 21 00 0F 00 0C 0F A5
5A 02 18 01 E8 02 18 00 9D 00 22 00 0F 00 0C 0F
A5 5A 02 19 01 F5 03 FF 00 9D 00 22 00 0F 00 0C
0F A5 5A 02 1A 02 19 03 FF 00 9D 00 22 00 0F 00
0C 0F A5 5A 02 1B 02 22 00 94 00 9D 00 22 00 0F
00 0C 0F A5 5A 02 1C 02 0E 00 10 00 9D 00 22 00

Best Answer

In particular look at "for" and "==" and hex2dec() and fprintf()