MATLAB: C Structure like variables in MATLAB

concatenateMATLABstructures

What I want to do is have Q – 10 bit & C – 4 bit and perform the operation –
Q,C = Q,C << 1 (left shift MSB of C into LSB of Q)
Where Q,C is 14 bit treated like a structure in C. This is natively supported in verilog, can be achieved with structures in C. How do I do something similar in MATLAB?

Best Answer

The only option is to use a singe variable that is the concatenation, and to use the bitwise operators to extract bits into Q and C.