MATLAB: How to unzip .Z files

downloaded filesgunzipunzipzip

I have a function that downloads .Z files using ftp. I want the function to be able to unzip those downloaded files and then delete the zipped versions. I have tried gunzip and unzip but I am not having any luck.
Related Question