이진 EDF 파일을 읽고 있는데, 특정 지점에서 여러 개의 작은 EDF 파일로 분할 한 다음 안에 값을 조정해야합니다. 전반적으로 잘 작동하지만 파일을 읽을 때 2 문자 배열을 서로 결합합니다. 분명히 모든 후미가 손상됩니다. 나는 막 다른 길에 서 무엇을 잘못하고 있는지 전혀 모른다. 문제를 포함한다MATLAB fwrite fread 문제 : 두 변수가 연결됩니다.
코드 (기록)의 부분은 : I는 리더를 사용하면
byt=fread(fid,8,'*char');
fwrite(tfid,byt,'*char');
fwrite(tfid,fread(fid,44));
%new number of records
s = records;
fwrite(tfid,s,'*char');
fseek(fid,8,0);
%test
fwrite(tfid,fread(fid,8,'*char'),'*char');
는 레코드 (fwrite(tfid,s,'*char')
) 다음 변수 값 결합. 이 전에 모든 변수가 올바르게 표시됩니다. 독자의 관련 코드는 :
hdr.bytes = str2double(fread(fid,8,'*char')');
reserved = fread(fid,44);%#ok
hdr.records = str2double(fread(fid,8,'*char')');
if hdr.records == -1
beep
disp('There appears to be a problem with this file; it returns an out-of-spec value of -1 for ''numberOfRecords.''')
disp('Attempting to read the file with ''edfReadUntilDone'' instead....');
[hdr, record] = edfreadUntilDone(fname, varargin);
return
end
hdr.duration = str2double(fread(fid,8,'*char')');
글쓰기 코드에's' 란 무엇입니까? 스칼라 또는 벡터? – gnovice
해당 문자 배열 문자열에 저장된 파일의 녹음 수 (문자 배열) – scylor