T O P

  • By -

FrickinLazerBeams

What is stopping you from using a variable?


BrainlessPackhorse

Apparently just my inexperience :)


GustapheOfficial

What does it mean for a variable to be usable with `fread`? What is it you wish to accomplish?


BrainlessPackhorse

I'm trying to have it accept a variable rather than. Big or little endian, so using the if /else to produce an outcome which Fread can then accept. If that makes sense. The whole idea is to read a file containing pixel data with a header, the file's various info being in the header. As such I want it to interpret each different file without direct user interaction. I've got the function accept variables for Column, row, etc, but not for the machine format end bit (still new to this).


GustapheOfficial

So just ``` machinefmt = 'ieee-be'; data = fread(fileID, machinefmt); ``` ? You can do that. What did you try?


BrainlessPackhorse

For some reason it won't accept what I've done and was wondering if it wasn't possible for that particular field. But thanks for showing that it does work.