MATLAB: Fwrite

fwrite

I tried to use fwrite which is described as saving in binary form but it saved it in numbers. At least my attempt did:
Created a new file rain2.tv and atached too numbers to it and read it afterwards:
>> fid=fopen('rain2.tv','w')
fid =
3
>> fwrite(fid, '2 4')
ans =
3
When i open the file rain2.tv it is in normal numbers not binary and when I look at the saved file it is also saved in normal

Best Answer

Hi Tor,
1) you save strings 2,4, not values (pass [2 4] instead of '2 4' to fwrite
2) you should pass the format ('double'), see fwrite doc
Titus