From: Ralph Page on
I am using:
DataValues=fread(fid,'2304*uint8',116);
To read in 2304 bytes, then skip 116 bytes and repeat for the entire file.
Works great.
I'd like to make the 2304 value a variable.
So far I have been unsuccessful, is it possible?

Thanks,

Ralph Page
From: Walter Roberson on
Ralph Page wrote:
> I am using:
> DataValues=fread(fid,'2304*uint8',116);
> To read in 2304 bytes, then skip 116 bytes and repeat for the entire file.
> Works great.
> I'd like to make the 2304 value a variable.
> So far I have been unsuccessful, is it possible?

DataValues=fread(fid,sprintf('%d*uint8',BytesToRead),116);
From: Ralph Page on
Walter Roberson <roberson(a)hushmail.com> wrote in message <i2vk6a$nu$2(a)canopus.cc.umanitoba.ca>...
> Ralph Page wrote:
> > I am using:
> > DataValues=fread(fid,'2304*uint8',116);
> > To read in 2304 bytes, then skip 116 bytes and repeat for the entire file.
> > Works great.
> > I'd like to make the 2304 value a variable.
> > So far I have been unsuccessful, is it possible?
>
> DataValues=fread(fid,sprintf('%d*uint8',BytesToRead),116);

Thanks Walter, works great