static matlab code for A=WH