|
"Wayne King" wrote in message <j62o8i$hiu$1@newscl01ah.mathworks.com>...
> "Nic Roberts" wrote in message <j62n8s$e16$1@newscl01ah.mathworks.com>...
> > Hi,
> >
> > I am trying to save data using fopen,fprintf and then trying to read it back in in using fread but fprintf seems to save the numbers as strings of ASCII characters even when I specify '%f'.
> >
> > How do write just the literal number and not have the values converted to ASCII ?
> >
> > Thanks
> >
> > Nic
>
> Hi Nic, Can you just give a small example of what you mean:
>
> fid = fopen('write_test1.txt','w','native');
> test = randn(10,1);
> fwrite(fid,test,'int16');
> array = fread(fid,10,'int16');
> class(array)
> ans =
>
> double
>
> Wayne
Hi Wayne,
Thanks for your response as soon as I saw it I realsied I should be using fwrite and not fprintf.
Thanks
Nic
|