fwrite and fread data of multiple precision to binary file
4 次查看(过去 30 天)
显示 更早的评论
Can anyone help me? fwrite and fread values are different. My trail is given below. i need to only read the sq values.
Thanks
r=1:100;
sq= sqrt(r)
fid = fopen('binary','w'); % Opening the file to write
%
if fid~=1
fwrite(fid, 8, 'uint8');
fwrite(fid, 'Table', 'char');
fwrite(fid, sq, 'float64');
fclose(fid);
end
fileid = fopen('binary','r');
if fileid~=1
equa = fread(fileid, 'float64');
fclose(fileid);
end
0 个评论
采纳的回答
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Low-Level File I/O 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!