You might check this website:http://www.mathworks.fr/fr/help/matlab/ref/netcdf.html
I think that the support for NetCDF files doesn't require a toolbox, but I'm not 100% sure. I used it about two years ago in my university where it worked just fine.
And once you figured out how to use the commands for reading and writing the NetCDF files, which is pretty simple, the rest is very straightforward. You will get a 2D array containing the terrain heights for all grid points which you can use like any other 2D array in MATLAB. Once you are done with your modifications just write it back to the file and you are done. The array you are looking for is called HGT_M - m for mass points - AFAIK the other HGT_* are not used by WRF so you can ignore them.