Hi, I am running Matlab on a remote Unix server. I am new to Unix, so something with the file structure is not meshing with my Matlab code. I first run my Matlab code on my windows machine, and everything works great. However, I run into problems on the Unix server. For example,
graph_path_fig = ['graphs\fig\'];graph_path_pdf = ['graphs\pdf\'];if exist([graph_path_fig],'file') rmdir([graph_path_fig],'s')elseendif exist([graph_path_pdf],'file') rmdir([graph_path_pdf],'s')elseendmkdir(graph_path_fig)mkdir(graph_path_pdf)
Then, I form a graph and try to save it as a .pdf and a .fig. The .pdf saves to the correct folder, while the .fig does not.
fh = figure(1);hold allh1 = plot(grid_num,grid_num_sq);set(h1,'LineStyle','-','LineWidth',2.0,'Color','Blue')hold offfilename = ['fig_practice'];save_fig = [graph_path_fig,filename];save_pdf = [graph_path_pdf,filename];saveas(fh,save_fig,'fig')saveas(fh,save_pdf,'pdf')
The .pdf saves to the correct file. The .fig does not. It saves in the directory of the mfile that I am running with the following name: graphs%5Cfig%5Cfig_practice
This is instead of the correct filepath of graphs\fig\fig_practice. Any help about how to circumvent this problem would be greatly appreciated.
All the best, Bob
Best Answer