(though hopefully more elegant) and then load the file as well. I am creating a Matlab GUI, and would love to be able to invoke and graph matlab data through Surfer.
Following Sarah Reed's post.
Make sure that you create a string file called "namefile" to run the grd_read_v2 function.
This may be done using "strcat" if the file name contains numbers and letters. e.g.
namefile=strcat('dem',num2str(1999),'.grd');
then run the function
>> [matrix xmin xmax ymin ymax]=grd_read_v2(namefile);
Hope this helps anyone in the future who uses this code (I encountered the same error as Sarah initially too).