MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi
Learn moreOpportunities for recent engineering grads.
Apply TodayMATLAB Central > MATLAB Newsreader > Binary matrix? 

I'm looking for suggestions on how to work with a 2D array of binary values. I have the data in a file, but I'd like to have a 2D matrix of binaries that I can look up values in. The matrix size is way too big to just let the binaries be wastefully stored as doubles. I could read the file in as characters or uint8 or something, but then I'd need to figure out how to index into this. Is there an easier way? 
"Chuck37" wrote in message <k5vp68$h5o$1@newscl01ah.mathworks.com>... 
Each element is a single bit. If I keep each element as uint8, I waste a lot of memory. I was only suggesting I could possibly read the file in as a stream of uint8, but then I'd have to index it, i.e. figure out which uint8 to use, then extract a particular bit from that uint8. If I could directly index B(x,y) and get binary/boolean results without wasting memory, that would be better. 
"Chuck37" wrote in message <k613c7$3kt$1@newscl01ah.mathworks.com>... 
"Matt J" wrote in message <k61he8$j5p$1@newscl01ah.mathworks.com>... 
"Chuck37" wrote in message <k62ic0$6in$1@newscl01ah.mathworks.com>... 
"Chuck37" wrote in message <k62ic0$6in$1@newscl01ah.mathworks.com>... 
No tags are associated with this thread.
A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.
Anyone can tag a thread. Tags are public and visible to everyone.