From: Joost Wagenaar on
Hi,

I was wondering if there is a way to determine the path of the last imported matlab variable. There are a couple of ways to get variables from the harddisk into matlab workspace:

1) double clicking in the finder/explorer
2) double clicking in the matlab browser window
3) dragging a .mat file into the matlab window

It seems that these methods call different internal functions but I don't believe it is possible to find out once the data is imported where it came from. However, if you double click in the finder/explorer the uiImport will call the finfo.m function which has access to the path. So it is possible to find the path of the double clicked item by overloading the finfo.m file and setting the path in a global variable or something.

However, this does not work for dragging a file or double clicking it in the matlab browser. Is there a hidden function in Matlab that can provide this information?

Thanks,
Joost