MATLAB: Opening a fig in different directory

opening fig different directory

hi. I have two .fig files: for example fig1 and fig2. fig2 is in a folder for example folderfig2. this folder is beside fig1. I want to open fig2 by clicking a push button in fig1. I should make this program exe so it dosnt have specified directory. what should I do?

Best Answer

When you want to use any file you have to specify the name of the file and its location. example
folder='E:\matlab'
filename='fig1.fig'
ful_file=fullfile(folder,filename)
Then use ful_file
Related Question