MATLAB Answer MATLAB Bitstream Question | Fast Solution

  • Thread starter Thread starter shekoofy
  • Start date Start date
  • Tags Tags
    Matlab
AI Thread Summary
The discussion revolves around optimizing memory usage in MATLAB for a long bitstream generated by an m-file. The main suggestion is to utilize data types like uint8 or uint64, which can store bits more efficiently than the default double type. Participants highlight the possibility of using bit-level operators such as bitset and bitget to manipulate individual bits. While packing multiple bits into a single data type is feasible, the discussion notes that with modern memory capabilities, the necessity of such optimization may be less critical. Overall, the focus is on efficient data storage methods in MATLAB for handling large bitstreams.
shekoofy
Messages
4
Reaction score
0
matlab easy question!

hi,
I,ve recently wrote a m-file in MATLAB which generates a kind of long bitstream,science it is a long stream i wonder if there is any pisibility that i could put them in a form that each bit occupies
exactly one bit rather than a double in workspace.
thank u all
 
Physics news on Phys.org


shekoofy said:
hi,
I,ve recently wrote a m-file in MATLAB which generates a kind of long bitstream,science it is a long stream i wonder if there is any pisibility that i could put them in a form that each bit occupies
exactly one bit rather than a double in workspace.

Yes, you could use one of the longer integer data types and bit-level operators. Try:

help uint64
help bitset
help bitget




-Will Dwinnell
http://matlabdatamining.blogspot.com/"
 
Last edited by a moderator:

Similar threads

Back
Top