Transform matrix creation in compressed sensing
I recommend not forming the transform matrix directly. That will cost more memory and take longer to compute the transform. Instead, use the idwt/dwt or waverec/wavedec functions in place of multiplying by A/A.T.
Many reconstruction solvers and convex optimisation toolboxes support supplying function handles for this instead of a matrix. If you are implementing your own solver it should also be easy enough to integrate these functions instead of the matrix-vector products.