matlab spectral code for rapid prototyping