filepath = 'C:\Desktop\2023-04-11-10-21-42_1.txt'; fid = fopen(filepath, 'r'); data = '1'; N = 0; while( 0 == strcmp('', data) ) data = fscanf(fid, '%s', 1); if ( 0 == strcmp('', data) ) N = N + 1; end end dataVec = zeros(N, 1); fseek(fid, 0, 'bof'); for i = 1:1:N data = fscanf(fid, '%s', 1); dotBuff = hex2dec(data); dataVec(i) = dotBuff; end
标签:十六进制,end,读取,filepath,fid,txt,data From: https://www.cnblogs.com/susiesnai-sun/p/17349392.html